SFTP Connection
Codeanywhere provides an option to connect to your Workspace using the Secure File Transfer Protocol (SFTP). The SFTP tool allows you to transfer files between your local machine and your Workspace, providing a secure and efficient way to manage your project files.
It uses the SFTP sync extension to enable adding, editing, or deleting files within a local directory and have it sync to a remote server directory using different transfer protocols like FTP or SSH.
Prerequisites
Before using the SFTP tool, ensure you have the following:
- A Codeanywhere account.
- A Workspace created in Codeanywhere.
- The SFTP sync extension installed in your Workspace.
Installation
- Select the
Extensions
tab. - Install the SFTP sync extension from the marketplace.
Usage
- Add an FTP Connection
- Open the
Extensions
tab and select theSFTP sync
extension. - Open a local directory you want to sync to the remote server.
- Click CMD/CTRL + SHIFT + P to open command palette, and run the
SFTP: config
command. - Configure the connection using the SFTP configuration file. The configuration files specifies the connection details, including the host, username, password, and the paths for local and remote environment.
- Configuration Setup
-
In the
sftp.json
configuration file, configure the following fields:name
: A string to identify your server connection.context
: The path within your project to use for the SFTP connection.host
: The hostname of your server.username
: Your server username.password
: Your server password.remotePath
: The directory on the server where the files should be synced.
Example sftp.json
configuration:
-
Save the
sftp.json
configuration file and copy it to a safe location to avoid losing the connection details. -
Start working with the SFTP connection.
Use the commands provided by the SFTP extension to upload, download, or delete files between your local and remote directories.