Remote editing should preserve a clear separation between development, staging, and production systems.
This guide focuses on a plain PHP workflow and can be adapted to framework-based projects where the same tools apply.
Prepare a dedicated development host
Use a development or staging server with a dedicated account and least-privilege permissions. Avoid editing production files directly as a normal workflow. Confirm that the remote host has the required PHP CLI version, Composer, Git, and project extensions.
Configure SSH access
Use a dedicated SSH key and a host entry in the local SSH configuration. Protect the private key with appropriate file permissions and a passphrase where practical. Verify the host fingerprint before accepting a new server identity. Do not paste private keys or passwords into editor settings.
Connect with Remote SSH
Install the official Remote - SSH extension in VS Code and connect to the configured host. VS Code installs its remote server component for the session. Open the project directory on the remote host and confirm that the integrated terminal runs the remote PHP executable rather than the local one.
Respect remote environment differences
Check PHP version, loaded extensions, Composer configuration, file ownership, environment variables, and database endpoints. Use sanitized development data. Never expose production credentials through workspace files or terminal logs.
Separate editing from deployment
Use Git branches and a reviewed deployment process to move changes from development to staging and production. Remote editing is not a substitute for backups, code review, automated tests, or deployment rollback. Keep production access restricted and auditable.
Practical verification checklist
- Confirm the editor uses the intended PHP 8.4 executable.
- Open the repository root and verify Composer dependencies.
- Run PHP linting and the project’s automated tests.
- Check that editor diagnostics match command-line results.
- Keep local credentials and production data out of the workspace.
Conclusion
Remote SSH is useful when the project runtime or files need to remain on a Linux host. Use a dedicated development environment, verify which PHP binary is running, and deploy through a controlled release process.