Host a Discord Bot Without an HTTP Server
A Discord gateway bot connects out to Discord and does not need a public HTTP endpoint. Upload a supported Python or Node.js project as a ZIP, run it with no bound port, and put the bot token in the app's environment variables. The process does not sleep for lack of inbound requests while the app has credit. You still need to check that the bot responds and reconnects after errors.
Why the bot needs no port
A gateway bot connects out to Discord and receives events on that connection. It needs no port binding unless you add a dashboard, OAuth callback, or webhook endpoint.
An HTTP pinger does not test whether the bot is handling Discord events. This platform does not sleep an app because it receives no requests. It also has no built-in health check for an unresponsive bot, so add monitoring for the behavior that matters.
Deploy the bot as a worker
- Put the bot's source and dependency manifest (
package.jsonorrequirements.txt) in one project folder. Removenode_modules, virtual environments,.gitand.envbefore making the ZIP. Check the upload size limit shown in the panel. - On Create application, upload the ZIP with the Runny AI Agent. Review the detected runtime and start command. If the project does not build correctly, check the ZIP requirements or use a Dockerfile.
- If the agent asks for
DISCORD_TOKENor another secret, enter it there. Check the app's Env Vars panel afterward and add anything it missed. Never put the token in the ZIP. - Start the app with no bound ports unless it actually serves HTTP. Read the logs, then send a real command to the bot in Discord.

If the bot uses a local SQLite database or writes files, mount a volume at the path it uses before relying on that data. Files outside the volume are lost when the container is replaced; keep separate backups of important data.
Your token, without hard-coding it
Read the token from an environment variable in your code. For example, use process.env.DISCORD_TOKEN in Node.js or os.environ["DISCORD_TOKEN"] in Python. Set the same name in the app's Env Vars panel if the ZIP flow did not request it. Changing it recreates the container briefly, so check the bot again afterward. If a token was committed or included in an archive, rotate it.
Does it actually stay up?
Two things to check after deployment:
Exited processes restart. The platform restarts the container when its process exits. A bot that remains running but loses its Discord connection may still appear healthy in the panel. Add reconnect and timeout handling, or exit on an unrecoverable error so the restart is visible. Check crash-loop logs.
A running bot uses a paid allocation. It is billed per minute for allocated CPU, RAM and disk while running. A new account gets a short first-app trial run; the app stops when that run ends unless you add credit.
Start with a small allocation, watch memory use and restarts, then adjust it for your bot. See the pricing calculator for a full-month estimate.
The bot is not stopped for receiving no inbound requests. That is separate from whether its code is working or whether the account has credit.
When your bot does need a port
If your bot also serves a dashboard, OAuth callback or webhook receiver, add the matching port from the app's Ports panel. The HTTP server must listen on 0.0.0.0, and the binding gets a platform HTTPS hostname. Custom domains are not currently supported.
FAQ
Do Discord bots need an open port?
No. Gateway bots make an outbound WebSocket connection to Discord and receive no inbound traffic. You only need a port if you add a dashboard, OAuth callback, or webhook endpoint.
Why does my bot go offline on free hosting?
Some hosts stop web services without inbound traffic. Check the host's worker or always-on option; those are usually a better fit for a gateway bot than a web-service tier.
Do I need a fake HTTP server and an uptime pinger?
No. Run the bot with no port binding. An external check of real bot behavior is still useful because the platform does not probe its health.
Where do I put my bot token?
In the app's environment variables. Enter it when the ZIP flow asks, or set it in the Env Vars panel. Do not include it in source, .env or the uploaded archive.
What does it take to keep it up 24/7?
Credit on your balance. The bot then runs continuously, billed per minute for the CPU, RAM and disk you allocate. A new account's first app gets a short trial run so you can check it works first.
Does it work with discord.py as well as discord.js?
Yes. Python and Node.js are supported ZIP runtimes. Include the dependency manifest and test the detected start command.
Wrapping up
Run the bot as the worker it is: no public port, token in environment variables, and a small allocation sized from actual use. Before relying on it, send a real Discord command, inspect logs, and decide how you will detect a lost connection or protect any data it stores.