Setup FTP (or FTPS or SFTP ) in PHPStorm

This tutorial shows you how to setup FTP/ FTPS /SFTP in PHPStorm step by step with screenshots.

Please note that I used PHPStorm 10.0.3 for this tutorial.

  1. Open your phpstorm and create/open your project.
  2. In the menu, click Tools >> Deployment >> Configurations…
  3. A model dialog box will open. You will see a green plus sign (+) there, click it.
  4. Another model dialog box will open.
    First, you will have to insert the name of this FTP/SFTP/FTPS connection. The name will be useful when you will add more than one FTP/SFTP/FTPS. In this case, you will be able to perform your action by selecting the name of FTP/SFTP/FTPS.
    Secondly, you will have to select to the type of connection that can be either FTP or SFTP or FTPS.
    Click “OK” after insert above two values.From here, I will user the term FTP because I am setting up FTP connection and not SFTP or FTPS. The method will be same for SFTP or FTPS.
  5. Now the previous dialog box will come back but it will have several fields that you will have to insert values into. Five of these fields are very important and required to make it work. Other fields totally depend on your requirement.


    Four important fields are on the “Connection” tab. Find below their explanation;
    FTP Host: It can be an IP address of your server, or it will be your domain name.
    Username & Password: You must have got it from your host or you must have created it in your hosting control panel.
    Save Password: You should check the “Save Password” field if do not want to be asked your password every time when you run PHPStorm and open your project and try to perform FTP action.One important field is on the “Mappings” tab.
    Deployment path on server: This is the path where your files will be uploaded or downloaded relative to your local project. If you have TestFolder/index.php in your project, where TestFolder is your actual project folder and not a sub-folder, then you should have /index.php on the server root. If it is not in the root, you can specify this path in this field where it exactly maps to your local folder.
  6. All other fields are self-explanatory and once you are done, click “Test FTP Connection” button and it will inform you about the details of your provided details by testing a connection if those were correct or not. Take appropriate action accordingly. Sometimes, the dialog box will go away and you will be on the PHPStorm main project window now.
  7.  To make it much more useful, and friendly, in the menu, click on Tools >> Deployment >> Browser Remote Host.
  8. A remote host window will appear and will fetch and display the files listing at your FTP server.
  9. Now you can upload the file to FTP or download from FTP by make a right click on file in Project explorer window and selecting “Deployment” and then appropriate action of Upload or Download.
  10. You can also perform and Upload or Download of a file or folder by performing a right click on file or folder in Remote Host explorer window.
  11. If a file is open in the editor, you can use shortcut keys combination to perform an Upload action to FTP.
    To upload opened file to FTP: Ctrl + Alt + Shift + X

That’s it.

Leave a Reply

avatar
  Subscribe  
Notify of