How to work in remote server with PhpStorm.

How to work in remote server with PhpStorm.

Working in remote server is a daily stuff for a web developer. Vim, nano or such tools usually take place to work in such environment. They work fine. But, nothing beats experience of a strong IDE. I felt a bit annoyed when to work in remote server with these tools. As my daily life is well equipped PHPstorm.

Here, we will discuss how you can download the remote project locally, and deploy the code on real time. So, any changes you can made, will be real time synced.

But, PHP Storm facilitates such tasks with its great alternative. Let’s try.

Jetbrains also provides an official doc to describe the issue.

Step 1.

In PhpStorm 2022.2.1 .

  • Go to File from top menu.
  • Choose the option New projects from existing files.

Step 2

Screenshot 2022-09-20 at 1.51.34 PM.png

  • You will get a pop up as like.
  • Select the option Web server is on remote host, files are accessible via FTP/SPTP/FTPS
  • Press ‘Next’ button.

Step 3

Screenshot 2022-09-20 at 1.51.44 PM.png

  • You will get another pop up to select where the project will be downloaded in your machine.
  • We will leave the option as it is.

Step 4

Screenshot 2022-09-20 at 1.51.52 PM.png

  • Here you will get the previous ssh set up.
  • You can also add another setup.

Step 5

Screenshot 2022-09-20 at 1.51.59 PM.png

  • Setup your ssh with smtp.
  • You should test connection before proceed.

Step 6

Screenshot 2022-09-20 at 1.52.23 PM.png

  • Press next button, You will find the remote project directories in server. (Now you are in server)
  • Go to the project. (e.g /var/www/project.)

Step 8

  • Start Download.
  • At first, PHPStorm will collect and index the file. So, Don’t worry, if you see the download has not started in few minutes.

Step 9

  • After Collecting, all file path, PhpStorm will start the downloading the files from remote server.
  • After completion of download, you are free to make any change in your code.

Step 10

Screenshot 2022-09-20 at 2.48.31 PM.png

  • After making any change, you need to deploy the code to server.
  • Right click on the file name, while keeping the file open.
  • At the bottom, you will get the option deploy.
  • Right click on it, Find the option to upload, download or compare.