Using Cursor with your own VPS instead of a managed cloud
- The pieces
- Keep the server boring
- Let the agent work in the repo
- Connect deploy context with MCP
- Environment variables
- What you replace, and what you do not
- Cost comparison
- A weekly routine
AI editors like Cursor make it fast to build an app. Deployment is where many people fall back on managed hosting, because a VPS feels like a lot of manual work. With the right setup, the editor can help run the server too, and the bill stays flat.
The pieces
- A VPS from any provider (2 to 4 GB of RAM is plenty for several small apps)
- A deployment layer on that VPS that handles builds, TLS and routing
- Git as the source of truth
- Optionally, an MCP connection so the editor’s agent can see deploy status and logs
Keep the server boring
Do not let the agent SSH in and improvise. The best results come from a server that is set up once, carefully:
- Create a non root user and disable password SSH logins
- Enable a firewall that allows only 22, 80 and 443
- Turn on unattended security updates
- Install Docker and your deployment platform
- Point a wildcard DNS record at the server
After that, day to day work happens through Git and the platform, not shell sessions.
Let the agent work in the repo
Cursor is excellent at writing Dockerfiles, Compose files, health endpoints and CI configuration. Ask it to:
- Generate a multi stage Dockerfile for your stack
- Add a
/healthzendpoint - Write a
.dockerignore - Add graceful shutdown handling
Review those changes like any other code, then push. The platform builds and deploys.
Connect deploy context with MCP
If your deployment platform exposes an MCP server, add it to Cursor with a token scoped to your project. Now you can ask “why did the last deploy fail?” and the agent reads the build log directly, instead of you copying and pasting it. Keep write actions limited to redeploys and rollbacks.
Environment variables
Never paste production secrets into chat. Keep them in the platform’s environment settings, and reference variable names in code. If the agent needs to know a variable exists, it can read names without values.
What you replace, and what you do not
A VPS plus a deployment layer can replace managed app hosting, preview deployments, cron jobs and small databases. It does not replace:
- Global CDNs for heavy static traffic (put a CDN in front)
- Managed databases with automatic failover if you truly need them
- Compliance certifications you inherit from big clouds
Cost comparison
A handful of side projects on managed platforms often run 20 to 60 dollars a month once each has a database. The same projects on one VPS can cost under 10, plus your deployment tool.
A weekly routine
- Glance at disk usage and backups
- Apply any pending updates
- Ask the agent to summarize errors from the week’s logs
There is a fuller walkthrough in this guide on using Cursor with a VPS to replace managed cloud.
Disclosure: I work on Peon, a deployment layer with an MCP server that fits this workflow.
Write a comment