shiply.now
Guides

How to Deploy a Replit App Elsewhere with a Real Backend

Ready to deploy a Replit app to production? Learn how to move your project to flat-rate hosting with a SQL database, custom domain, and no surprise bills.

If you've ever tried to deploy a Replit app and hit the wall where you need a backend that doesn't vanish the moment you close your browser, you're not alone. I've been there. Replit is a phenomenal prototyping tool. I use it. You probably use it. AI agents inside Replit can spin up a working app in minutes, and that dopamine hit of seeing something functional is real. But the second you need a permanent URL, a real database, or server-side logic that survives a traffic spike, Replit's built-in hosting starts to feel like a rented apartment where the landlord keeps changing the locks.

Table of Contents

This guide is for the developer who built something real in Replit and now needs to give it a proper home. Not a preview link that expires. Not a static snapshot that can't handle a login form. A production host with a SQL database, edge functions, and a custom domain, all on flat-rate pricing that doesn't punish you when your client's site gets popular. By the end, you'll know exactly how to move your Replit project to a host that treats your app like a product, not a demo.

Why Replit's Built-in Hosting Isn't Enough for Production

Replit offers four deployment types: Autoscale, Reserved VM, Static, and Scheduled. On paper, that sounds comprehensive. All published apps run on Google Cloud Platform with single-tenant GCP projects per customer, which is a legit infrastructure choice. The problem isn't the cloud underneath. The problem is what you actually get, and what you don't.

The free Starter plan caps you at one published app. One. If you're a freelancer or solo builder shipping multiple client projects, that's a non-starter. Upgrading to Core or Pro removes the limit, but here's where it gets murky: Replit doesn't publish concrete pricing for Autoscale or Reserved VM deployments. The docs use phrases like "lowest possible cost" and "predictable pricing" without ever giving you a dollar figure. That's a red flag when you're trying to quote a client a monthly hosting cost.

Laptop displaying Google Analytics in a modern workspace, highlighting digital analytics and technology.
Photo by Negative Space on Pexels

Then there's the snapshot model. When you publish on Replit, the platform takes a frozen copy of your files and dependencies and deploys that, separate from your editor. This is fine for a demo. It's painful when you're iterating with live data and need to push changes that interact with a database. Your published app and your editor are two different things, and syncing them requires a redeploy every time.

Static deployments are the most common path for AI-built apps coming out of Replit, and they're the most limited. You get a preview URL that expires, zero backend execution, no SQL database, no server functions, and no transactional email. Your app is a brochure. It can't handle a contact form, a user login, or a saved preference. The Reddit consensus on "How is Replit for production deployment?" is blunt: fine for prototypes, move it for real users. The gap is obvious once you've shipped something that needs to do more than display static HTML.

What You Actually Need From a Production Host

Before you move your app, let's get clear on the baseline. A production host isn't just a place that serves files. It's infrastructure that makes your app functional for real users and professional for paying clients.

You need a permanent URL that doesn't expire after seven days or when your laptop goes to sleep. Your client needs to send people to a link that works next month, next quarter, next year.

Close-up of a computer screen displaying programming code in a dark environment.
Photo by luis gomes on Pexels

You need a real SQL database. Not ephemeral storage that resets on redeploy. Not a key-value store that can't handle relational queries. Your users create accounts, save preferences, submit forms. That data has to live somewhere persistent and queryable. Cloudflare D1 or Neon Postgres are the standard answers here.

You need server or edge functions so you can handle webhooks, authenticate users, or run background jobs without spinning up a whole VM. Workers Lite on a flat-rate plan covers this without surprise compute charges.

You need a custom domain with automatic DNS management. Shipping a client site on your-app.replit.app doesn't inspire confidence. Cloudflare-managed DNS should be a checkbox, not a weekend project.

And you need predictable pricing. No Autoscale meter that quietly burns through your budget when a Reddit post sends 500 concurrent users to your app. Flat rate means you know the bill before the month starts. If you're billing a client for hosting, you can't afford a variable cost you didn't anticipate.

Step-by-Step: How to Deploy a Replit App to a Flat-Rate Host With a Backend

Step 1: Export Your Replit Project Cleanly

Replit stores your code, dependencies, and environment configuration in a snapshot. The cleanest way to export is through Git. Initialize a repository in your Replit workspace, commit everything, and push to GitHub or GitLab. This preserves your file structure, your replit.nix or pyproject.toml configs, and your full commit history.

If you used Replit's built-in database or Storage, export that data now. Dump it as a SQL file or a JSON export. You'll migrate it to the new host's database in Step 3. Don't skip this. Once you delete your Replit project or let the hosting lapse, that data is gone.

Strip out any Replit-specific environment variables before you push. Things like REPL_ID, REPLIT_DB_URL, or REPL_OWNER won't exist on your new host, and they can cause silent failures that are a nightmare to debug. Replace them with placeholder values or remove them entirely. Your new host will have its own environment variable system.

Step 2: Choose Your Deployment Method

If your Replit app is a static site, you have options. A Vite build, an Astro site in static mode, or plain HTML/CSS/JS can deploy to any static host with a single command from your AI agent. But here's the thing most guides won't tell you: static-only is a dead end if your app does anything interactive.

If your app uses server-side rendering, a framework like Next.js, SvelteKit, or Remix, or needs backend logic, you need a host that supports edge functions. The deployment command is still one call from Claude, Cursor, or ChatGPT. You specify your framework, and the host auto-detects your SSR routes and deploys them as Workers. No manual configuration. No YAML files. No "it worked on my machine" debugging sessions.

The key difference between a real production host and a static dump is what happens when a user submits a form, logs in, or queries a database. A static host returns a 404 or silently fails. A proper host executes your server-side code and returns a response. If your Replit app has a login form, a comment section, or any kind of data persistence, you need the latter. You can check the hosting cost calculator to see exactly how flat-rate pricing compares to metered alternatives before you commit to anything.

Step 3: Set Up Your Database

Create a new database on your host. Cloudflare D1 and Neon Postgres are both SQL, both fast, and both give you a connection string you can drop into your environment variables. If you exported a SQL dump from Replit, import it now. If you were using Replit's key-value store, you'll need to rewrite those queries as SQL. It's a one-time migration, and it's worth it. Relational data means you can query, filter, and join tables. A key-value store means you're doing all that logic in application code, which gets messy fast.

Your host should give you a DATABASE_URL connection string. Set it as an environment variable. Your app reads from that. No hardcoded credentials. No secrets committed to your repo.

If your Replit app used the built-in replit.database module, swap it for a standard SQL client library. Use better-sqlite3 for D1 or pg for Postgres. The logic stays the same. The syntax changes slightly. A few hours of work, and you've gone from a toy database to something that can handle real traffic.

Step 4: Configure Custom Domain and Email

Point your domain's nameservers to Cloudflare, or use your host's auto-DNS if they offer it. Shiply does this with one click. SSL is automatic via Cloudflare's edge certificates. You don't need to touch a certificate authority or configure anything manually.

For transactional email, set up your host's email capture feature or integrate with Resend or SendGrid. Password resets, order confirmations, form submission notifications, all of that needs to work. Your host's site data capture inbox can collect form submissions without you writing a single endpoint. The site data feature stores submissions and lets you view them in a dashboard or forward them to your client.

If you're handing the site off to a client, use atomic ownership transfer. The client takes over billing, and you get paid immediately via Stripe Connect. No awkward "Venmo me for the hosting" conversations. No shared logins. No ongoing support requests about billing six months later. Clean break, clean handoff.

Step 5: Test, Then Hand Off

Deploy a staging version first. Verify your database connections work. Test your edge functions end to end. Run through every email flow. Run a Lighthouse audit. Your flat-rate host should serve from Cloudflare's edge network, so performance should be solid out of the box. If something's slow, it's probably your database queries, not your hosting.

Once staging passes, promote to production. Your permanent URL is live. No usage meter. No surprise bill at month-end. The pricing page shows exactly what you'll pay, whether you're on the free tier or the $24 plan with multiple sites and databases.

If you're delivering to a client, use the atomic transfer feature. They get full ownership of the site, the domain, and the database. You get paid. The site keeps running. Everyone moves on.

Alternatives Worth Knowing About

Vercel is the obvious comparison. It's great for Next.js, and the free tier is generous. But backend functions are metered. The Hobby plan gives you 500 GB-hours, then it's $0.18 per hour after that. If your app gets traction, the bill climbs fast. There's no built-in SQL database. You bring your own via Neon or Supabase and pay separately. Two bills, two dashboards, two pricing models to track.

Railway is simpler. Deploy from GitHub, and it supports most frameworks. But pricing is usage-based: CPU, memory, bandwidth all tick up. A single app with a Postgres database can run anywhere from $5 to $20 a month depending on traffic. No flat-rate option. If your client's site goes viral for a day, you eat the cost or pass it on.

Heroku is the old guard. Predictable pricing at $7 per dyno plus $9 for Postgres. But there are no edge functions, no AI-agent-friendly deploy, and you're managing dynos and buildpacks like it's 2015. It works. It's just not built for the way developers ship in 2026.

Shiply takes the opposite approach. Flat rate at $0, $8, $24, or $49 per month. No usage meter. One API call from Claude, Cursor, or ChatGPT deploys any app, static or SSR, with a per-site SQL database, edge functions, custom domain with auto-DNS, and transactional email. Atomic ownership transfer for client handoffs. The free tier includes one app with a database, which is enough to test the workflow before you commit. For a deeper look at how this compares to the dominant player in the space, the Vercel alternative page breaks down the pricing and feature differences in detail.

The bottom line: if you want to deploy a Replit app elsewhere and you need a backend, you're choosing between metered pricing and flat-rate. For a client site that needs to just work without cost surprises, flat rate wins every time.

Common Pitfalls When Moving Off Replit Hosting

Forgetting environment variables is the number one cause of failed deploys. Your Replit app probably used REPLIT_DB_URL, REPL_ID, or REPL_OWNER. Your new host won't have any of these. Replace them with your actual database connection string and a unique app identifier before you deploy. Test locally if you can.

Assuming static hosting is enough is the second most common mistake. If your app has a login, a database query, or a form that sends email, static-only hosts like Netlify, GitHub Pages, or Cloudflare Pages without functions will fail silently. The page loads, but nothing works. You need server-side execution.

Ignoring the database migration is the third. Replit's built-in database is a key-value store, not SQL. Moving to a SQL database means rewriting queries. It's a few hours of work, but it's the difference between a demo and a real app. Do it once, do it right.

Not testing the handoff is the one that burns you at 11 PM on a Friday. If you're delivering to a client, test the atomic transfer process on a staging site first. Make sure the client can log in, see billing, and manage the domain. Don't learn the hard way that something's broken when your client is trying to update their DNS and you're at dinner.

Final Thoughts: Ship With Confidence

You built something real in Replit. Now give it a home that doesn't nickel-and-dime you or your clients. Flat-rate hosting with a backend isn't a luxury. It's the baseline for anything you'd call production-ready.

The workflow is simple: export from Replit, deploy with one call from your AI agent, add a database, point a domain, and hand it off. No usage meters. No surprise bills. No "your preview URL expired" emails. Just a permanent URL with a real backend, running on infrastructure that scales without punishing your wallet.

If you want to try it, the free tier gives you one app with a SQL database and a permanent URL. Deploy your Replit app there, test the backend, and see how flat-rate feels. Your clients will thank you, and you'll stop dreading the monthly hosting invoice.

Publish a site in one call.

No account needed. Live at a real URL in a single request.