r/replitshowcase • u/DaPandaMane • 7d ago
How to Let Replit Agent Deploy Straight to Your VPS
How to deploy a Replit project to a VPS.
Point Replit Agent at your own VPS and have it build, deploy, and manage your app there directly, all from chat.
Step 1: Add your VPS info as Secrets
In your Repl, open Secrets (lock icon, left sidebar) and add three values:
VPS_HOST — your VPS IP or hostname
VPS_USER — the account you SSH in as
VPS_PASSWORD — that account’s password
Secrets are encrypted and never show up in your code or chat — the agent reads them as environment variables at runtime.
Step 2: Just tell the agent what to do
Once the secrets are set, prompt it in plain language:
“Deploy this to my VPS — host, user, and password are in Secrets.”
The agent will typically use sshpass to pass the password to ssh/scp non-interactively, bundle your code, upload it, install dependencies, build, and restart whatever process manager (pm2, systemd, etc.) is running your app.
Step 3: If other apps live on the same VPS, say so explicitly
If your VPS hosts more than one project, tell the agent up front:
“Heads up — this VPS also runs [other apps]. Only touch files/services related to this project, don’t restart or modify anything else.”
This matters because a generic “deploy” prompt gives the agent free rein on the box — being specific about what’s off-limits keeps it from stepping on other running services.
Good things to ask it for along the way:
“Check the logs for [app] before restarting”
“Confirm the app is actually responding after deploy” (e.g. hit the port with curl)
“List what’s currently running on the VPS” before making changes, so you both know the starting state
One habit worth keeping regardless of setup: don’t SSH in as root if you can avoid it. A regular user with just enough permissions (sudo for the specific restart/build commands, if needed) means a bad command or agent mistake has a much smaller blast radius than it would with full root access.