Access
Connecting to site files via PhpStorm
On this page
Connecting to FTP in PhpStorm involves configuring a remote server and creating mappings for file synchronization. Here’s a detailed guide.
Configure FTP/SFTP
Launch PhpStorm. Open the project you want to configure connection for, and go to "File" → "Settings".
Add a new server by navigating to "Build, Execution, Deployment" → "Deployment" in the settings. Click the "+" icon and select "FTP" or "SFTP" if using a secure connection. Enter the server name and click "OK".
"Connection" tab:
- Host: Enter the server IP address.
- Port:
21for FTP,2222for SFTP. - User name: Enter the FTP/SFTP username.
- Password: Enter the FTP/SFTP password.
- Select "Passive mode" if needed (useful for bypassing network restrictions).
You can learn about creating FTP accounts in FASTPANEL® in this article and about SFTP accounts in this one.
Click "Test Connection" to verify the connection. If successful, a message will appear: Connection successful.
Go to the "Mappings" tab. Specify the "Deployment Path": the directory path on the server where files will be placed (e.g., /).Close the settings window by clicking "OK".
Working with Files
To download files from the server, right-click on the project or file → "Deployment" → "Download from [Server Name]". To upload files to the server, right-click on the project or file → "Deployment" → "Upload to [Server Name]".
To enable automatic upload of changes go to "Tools" → "Deployment" → "Automatic Upload" → "Always".
Connecting to site files via VSCode
On this page
To connect via SSH and FTP/SFTP, Visual Studio Code uses an extensions that provides convenient access to remote files.
SSH
Install the extension
Open Visual Studio Code. Click on the "Extensions" icon in the sidebar (square icon), in the Extensions view, search for SSH.
Click "Install" on the extension named "Remote - SSH" by Microsoft.
Set Up SSH Keys
To connect via SSH without a password, please set up your SSH key in FASTPANEL using this article.
You can find out the site user in the site card, field "Site user". To change the site user password, go to "Management" → "Users" section in FASTPANEL®.
Configure SSH in VSCode
Press F1 on Windows/Linux or Cmd+Shift+P on Mac to open the Command Palette, type and select Remote-SSH: Add New SSH Host, and then enter the SSH connection string in the format:
ssh site_user@11.22.33.44Replace site_user and 11.22.33.44 with the appropriate values.
Instead of site_user you need to specify the site user, and instead of 11.22.33.44 the IP address of your server. Аfter entering the command сhoose the config file to save the SSH configuration (usually ~/.ssh/config).
Connect to the Remote Server
Press F1 on Windows/Linux or Cmd+Shift+P on Mac to open the Command Palette, type and select Remote-SSH: Connect to Host, choose the previously added host, accept the server’s fingerprint and enter the passphrase for your SSH key if it’s the first time connecting, and, if prompted, enter your password.
After you are connected, go to "Explorer" → "Open Folder" to open a folder on the host.
For example, /var/www/site_user/data/www/example.com.
Open Files and Start Coding
Once connected, VSCode will reload, and you'll be able to browse files on the remote server directly in VSCode. You can open, edit, and save files just like you would on your local machine.
For more information, please see the extension documentation.
FTP/SFTP
Install the Extension
Open Visual Studio Code. Click on the "Extensions" icon in the sidebar (square icon). Type SFTP in the search bar. Click "Install" to install the selected extension.
Configure the Connection
Open the Command Palette by pressing F1 on Windows/Linux or Cmd+Shift+P on Mac, type SFTP: Config, and then edit the configuration parameters with your remote server information in the sftp.json file under the .vscode directory. For example:
{
"name": "My Server",
"host": "11.22.33.44",
"protocol": "ftp",
"password": "password",
"port": 21,
"username": "ftp_user",
"remotePath": "/",
"uploadOnSave": false,
"useTempFile": false,
"openSsh": false
} You can learn about creating FTP accounts in FASTPANEL® in this article and about SFTP accounts in this one.
"host": IP address of your server."protocol": Specifyftporsftp."port": 21 for FTP or 2222 for SFTP."username"and"password": Login and password for FTP/SFTP account."remotePath": Specify the directory on the server you want to work with."uploadOnSave": Option for automatic upload when saving the file.
The password parameter in sftp.json is optional; if left out, you will be prompted for a password on sync. Save and close the sftp.json file.
Working with Files
Open the command palette, press F1 on Windows/Linux or Cmd+Shift+P on Mac. Then, type SFTP to see a number of available commands, which you can also access from the project’s file explorer context menus.
To sync with a remote folder, use the SFTP: Download Project command, which will download the directory specified in the remotePath setting in sftp.json to your local open directory.
Remote Explorer
Remote Explorer lets you browse remote files. You can open Remote Explorer by run Command View: Show SFTP. After Click the SFTP view in the Activity Bar.
You can only view a file’s content with Remote Explorer. Use SFTP: Edit in Local to edit it locally.
FASTPANEL