SSH
Learn how to set up and use SSH to connect your local development environment to Replit Apps for secure remote access and file synchronization.
What is SSH?
SSH, which stands for Secure Shell, is a secure protocol that facilitates remote access to your Replit App’s command line interface. With SSH, you can seamlessly transfer files and leverage your preferred local Integrated Development Environment (IDE) for editing code on Replit, enhancing collaboration and productivity in your development workflow.
SSH functionality is available for Core, Teams, and all other paid plans.
Here’s an overview of the process:
- Generate a SSH keypair on your local machine
- Add that SSH key to the “SSH” Pane inside any Replit App
- Connect using an SSH client or an editor which can work over SSH (like VSCode or Cursor)
:::note SSH Keys are associated with your your account, not a particular Replit App. This means that you only need to add a public key once, after which you can connect to any Replit App you have access to. :::
Why use SSH?
-
Automatic updates between Replit App and editor: Any changes made in the Replit App are reflected in your editor instantly, and any modifications in the editor are updated in the Replit App. This seamless synchronization ensures that your codebase is always up-to-date across platforms.
-
File management synchronization: Whether you add, delete, or update files, these changes are synchronized in real time between your editor and the Replit App. This feature ensures that your project structure remains consistent, regardless of where the changes are initiated.
-
Folder management and file moving: Moving files across folders is also synchronized between your editors and the Replit App. This ensures that organizational changes made in one environment are accurately reflected in the other, maintaining the integrity and structure of your project.
Find or Create a keypair
To configure SSH for your account, you’ll need your SSH public key.
Figuring out if you already have a keypair
You can check if you already have a public key by running the following command in a Terminal on your local computer:
If you get an error, that’s OK, proceed to Generating a new keypair.
If you see a file called replit.pub
, please proceed to Get the contents of your public key.
Generating a new keypair
On your machine, open a Terminal (or Command Prompt) window and paste the following command:
This command checks if a specific SSH public key file already exists. If not, it creates a new SSH key with some sensible parameters.
Get the contents of your Public Key
Once you have either confirmed you have a keypair or created one, display the contents of the public key (one of the two similarly named files, suffixed with .pub
), as we’ll need that for later.
Save the contents of replit.pub
to use later in this article and proceed to add the SSH key to your account.
Add the SSH key to your account
When you have multiple public keys on your machine, it’s important to ensure that you use the correct combination of private and public keys for your SSH configuration.
Connecting to your Replit App
Was this page helpful?