Host your Discord bot for free on FPS.ms with Python or Node.js. Upload your code, set up dependencies, and your bot runs 24/7 — no credit card required. This guide walks you through the full setup for both languages.
Prerequisites
Before you start, make sure you have:- An FPS.ms account — create your first server and select a Discord bot package (Python or Node.js)
- A Discord bot token — follow our getting your bot token guide if you don't have one yet
- Your bot code ready to upload
Python or Node.js?
Not sure which to pick? Python with discord.py is great for beginners, while Node.js with discord.js is better if you already know JavaScript. Both run 24/7 on FPS.ms for free.
Python setup
FPS.ms runs your Python bot by executingapp.py as the entry point by default. Follow these steps to get your bot online.
1. Create your main file
Create a file namedapp.py — this is the file FPS.ms runs when your server starts. You can change the entry point filename in the Startup tab if needed.
Important
Your main file must be named
app.py (or whatever you set in the Startup tab). Without it, you will see the error: /usr/local/bin/python: can't open file '/home/container/app.py': [Errno 2] No such file or directoryapp.py
import os
from dotenv import load_dotenv
import discord
load_dotenv()
class MyClient(discord.Client):
async def on_ready(self):
print(f'Logged on as {self.user}!')
async def on_message(self, message):
if message.author == self.user:
return
print(f'Message from {message.author}: {message.content}')
intents = discord.Intents.default()
intents.message_content = True
client = MyClient(intents=intents)
client.run(os.environ['BOT_TOKEN'])
Security
Never hardcode your bot token directly in your code. Store it in a
.env file instead — see our environment variables guide to set this up on FPS.ms.2. Add your dependencies
Create arequirements.txt file listing the Python packages your bot needs. FPS.ms installs these automatically when your server starts.
requirements.txt
discord.py
python-dotenv
requirements.txt.
Important
Without a
requirements.txt or packages listed in the Startup tab, your bot will crash with ModuleNotFoundError: No module named 'discord'. List every package your bot imports.3. Upload and start
- Upload
app.pyandrequirements.txtto your server via the Files tab in the panel or through SFTP - Create a
.envfile with your bot token — see the environment variables guide - Click Start on the Console tab
Logged on as YourBot#1234! in the console when it connects successfully.
Node.js setup
FPS.ms runs your Node.js bot by executing the start script defined inpackage.json. You have three ways to get your code onto the server.
Upload methods
| Method | Best for | How it works |
|---|---|---|
| **GitHub repository** | Active development | Enter your repo details in the **Startup** tab, then press **Reinstall Server** |
| **SFTP upload** | Large projects | Upload your project folder via [SFTP](/getting-started/connecting-to-sftp/) |
| **Panel file manager** | Quick edits | Create and edit files directly in the **Files** tab |
Important
Do not upload the
node_modules or .npm cache folders. FPS.ms generates these automatically from your package.json.- Go to the Startup tab on the panel
- Enter your Git Repo Address (e.g.,
https://github.com/yourname/your-bot) - Optionally set the Branch, Git Username, and Git Access Token (required for private repos)
- If you have existing files on the server, select all files and delete them first
- Click Reinstall Server to pull the code from GitHub
- Your repo will be pulled fresh on reinstall, and updated automatically on every restart if Auto Update is enabled
Clear files first
If you already have files on the server, delete them before reinstalling from GitHub. Otherwise the clone may fail because the directory is not empty.
1. Create your project files
You need at minimum three files. Here is a working example based on the official Discord.js guide:package.json
{
"name": "my-discord-bot",
"version": "1.0.0",
"description": "My Discord bot hosted on FPS.ms",
"main": "index.js",
"scripts": {
"start": "node ."
},
"dependencies": {
"discord.js": "latest",
"dotenv": "latest"
}
}
index.js
require('dotenv').config();
const { Client, Events, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
client.once(Events.ClientReady, readyClient => {
console.log(`Ready! Logged in as ${readyClient.user.tag}`);
});
client.login(process.env.BOT_TOKEN);
Security
This example reads the token from the
BOT_TOKEN environment variable. Store it in a .env file on your server — see our environment variables guide.2. Upload and start
- Upload your project files using one of the methods above
- Create a
.envfile with your bot token - Click Start on the Console tab
npm install to install your dependencies, then starts your bot. You should see Ready! Logged in as YourBot#1234 in the console.
Using TypeScript?
FPS.ms supports TypeScript natively via
ts-node. Set the Main file in the Startup tab to your .ts file (e.g., index.ts) and it will run directly — no need to compile to JavaScript first.Python vs Node.js comparison
| Feature | Python (discord.py) | Node.js (discord.js) |
|---|---|---|
| Entry point | `app.py` (configurable in Startup) | `index.js` (configurable in Startup) |
| Dependencies | `requirements.txt` | `package.json` |
| Language | Python | JavaScript |
| Best for | Beginners, data-heavy bots | JS developers, large-scale bots |
| Community size | Large | Very large |
| Slash commands | Supported | Supported |
Next steps
Your bot is now running 24/7 on FPS.ms. Here is what to do next:- Edit your bot code — update files via the panel, SFTP, or VS Code live sync
- Set up environment variables — securely manage your bot token and config
- Add slash commands — make your bot interactive with modern Discord commands
- Create a schedule — set up automatic restarts or timed tasks
- Upload files via SFTP — transfer files securely to your server
Troubleshooting
Having issues? Check these common problems:| Error | Cause | Fix |
|---|---|---|
| `No such file or directory: app.py` | Missing entry point | Create `app.py` in the root directory |
| `ModuleNotFoundError: No module named 'discord'` | Missing dependencies | Create `requirements.txt` with `discord.py` |
| `TOKEN_INVALID` | Wrong or missing bot token | Check your token in the `.env` file |
| Bot starts but goes offline | Code error or crash loop | Check the **Console** tab for error messages |
| `Cannot find module 'discord.js'` | Missing `package.json` | Upload your `package.json` with discord.js as a dependency |
bbassie
Edited by CanerAkar