Guide

Moving a bot off Replit or Glitch

For years they were where tutorials told you to host a bot. Glitch has stopped hosting projects, and Replit no longer keeps a free project running. Here is how to move yours.

← All guides3 min readUpdated

What changed

Glitch ended project hosting in 2025. Projects there no longer run at all, so a bot that lived on Glitch is offline until it moves.

On Replit, a project in a free workspace runs while you have it open and stops when you leave. Keeping something running continuously needs one of Replit's paid deployments. The "Always On" option and the keep-alive tricks older tutorials relied on no longer keep a free bot up.

The good news is that a bot written for either is ordinary Node.js or Python underneath, and almost all of it moves unchanged. The work is in the handful of places that relied on the platform.

Get your code out

On Replit, open the project, use the three-dot menu in the Files panel and choose Download as zip. If the project is connected to GitHub, cloning the repository works just as well.

From Glitch, use whatever copy you still have — a download, a GitHub export, or your own local copy. If none exists, a bot is usually small enough to reassemble from its files faster than it sounds.

Before you go further, open the project's Secrets (Replit) or .env (Glitch) and copy out every value: your bot token, API keys, database URLs. They are not in the download, and they are the part that is hardest to get back.

Delete the platform files

Some files only mean something to the old platform and can go: .replit, replit.nix, replit.md, glitch.json and .glitch-assets. Keep package.json, requirements.txt and your code.

On Replit, a Python project may list its packages in pyproject.toml managed by Poetry rather than in requirements.txt. Most hosts, ours included, install from requirements.txt, so create one listing the packages your bot imports — discord.py, python-dotenv and so on — one per line.

Replace Replit Database

Replit Database, used through @replit/database in Node.js or "from replit import db" in Python, only works on Replit. If your bot stores data with it, that part has to change.

For a small bot, SQLite is the natural replacement: a single file on disk, no server to run, and a library for every language. For the smallest amounts — a few settings per server — a JSON file read at startup and written on change is enough. Export your data first: a short script run on Replit that prints every key and value will do it.

Python, before and after

# Before, on Replit
from replit import db
db["prefix"] = "!"

# After: the standard library, no package needed
import sqlite3

conn = sqlite3.connect("bot.db")
conn.execute("CREATE TABLE IF NOT EXISTS kv (key TEXT PRIMARY KEY, value TEXT)")
conn.execute("INSERT OR REPLACE INTO kv VALUES (?, ?)", ("prefix", "!"))
conn.commit()

Remove the keep-alive server

Many Replit bots start a tiny web server — often a file called keep_alive.py, or an Express app listening on port 3000 — so an outside service could ping it and stop Replit putting the project to sleep. On a host that does not sleep your bot, it does nothing useful.

Delete the file and the line that starts it, such as keep_alive() before bot.run(). If your bot genuinely serves web pages or receives webhooks, keep the server, but have it listen on 0.0.0.0 and on the port your host gives it — on ours, the SERVER_PORT environment variable — rather than a hard-coded one.

Secrets become environment variables

Replit Secrets and Glitch's .env both reached your code as environment variables, so process.env.TOKEN in Node.js and os.environ["TOKEN"] in Python keep working unchanged. What changes is where you set them: in the new host's settings, or in a .env file loaded by dotenv. The guide to keeping tokens in environment variables covers both.

Moving it to our hosting

Create a free server for the bot's runtime, upload the project (without node_modules or a virtual environment), set the entry file and your environment variables, and start it. Dependencies install from package.json or requirements.txt on deploy, and the server stays on without a keep-alive trick or a paid add-on.

If your bot is not a Discord bot — a Telegram, Twitch or Reddit bot, or a small web app — the same steps apply. The console shows its output from the first start, which is where any leftover Replit-specific import will show up as an error.

FAQ

Questions

Can I keep using Replit to edit the code?

Yes. Edit wherever you like and upload the changed files to where the bot runs. Just make sure it only runs in one place, or two copies will fight over the same token.

My Glitch project is gone. Is the bot lost?

The code may be, but the bot is not. The bot itself lives in the Discord Developer Portal, with its name, avatar and the servers it is in. Any program that logs in with its token becomes that bot again.