If you’ve read my blogs before than you probably know that I like to keep it short. So here you go;
- Enable SSH for your application
- Enable Application Access
- Set your webroot to public_html/root (or something similar)
- Move the files inside public_html to the newly created folder (root)
- Update your VSCode settings.json file and include something like below
- And don’t forget to enable SSH Access in Application Settings!
"remote.SSH.serverInstallPath": {
"{HOSTNAME}": "/home/{SERVER_ID}.cloudwaysapps.com/{APPLICATION_ID}/public_html/.vscode-server",
}
In this case {HOSTNAME} refers to the SSH hostname, if you connect with ssh user@domain.com
than the hostname is domain.com
.
{SERVER_ID} and {APPLICATION_ID} can be found by connecting to SSH and then running the pwd
command.
Why does this not work by default?
VSCode needs to install some configuration files and wants to save them in /home/{SERVER_ID}.cloudwaysapps.com/{APPLICATION_ID}/.vscode-server
by default, Cloudways does not allow saving files outside of the public_html
Pradeep Maheepala says
Just wanted to thank you for the great post that explains the root cause and a workaround for an issue that has been really frustrating for me since moving to Cloudways.
Marinus Klasen says
Glad it was helpful!
Minerva Messer says
I just went to your site. i have a question is this a good way to contact you?