Browse documentation

Installation

Host your Discord bot for free on FPS.ms with Python (discord.py) or Node.js (discord.js). Step-by-step setup for code, dependencies, and startup — running 24/7 in minutes.

bbassie Updated Edited by CanerAkar
On this page

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. This guide walks you through the full setup for both languages.

Prerequisites

Before you start, make sure you have:

  1. An FPS.ms account — create your first server then open the Containers tab on the Deploy page and choose Python or NodeJS
  2. A Discord bot token — follow our getting your bot token guide if you don't have one yet
  3. 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 executing app.py as the entry point by default. Follow these steps to get your bot online.

1. Create your main file

Create a file named app.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 directory

Here is an example Discord.py bot:

app.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 a requirements.txt file listing the Python packages your bot needs. FPS.ms installs these automatically when your server starts.

requirements.txt
discord.py
python-dotenv

You can also install additional packages via the Startup tab under Additional Python packages without editing 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

  1. Upload app.py and requirements.txt to your server via the Files tab in the panel or through SFTP
  2. Create a .env file with your bot token — see the environment variables guide
  3. Click Start on the Console tab

Your bot should come online within a few seconds. You will see 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 in package.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
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.

Using a GitHub repository

To deploy from GitHub:

  1. Go to the Startup tab on the panel
  2. Enter your Git Repo Address (e.g., https://github.com/yourname/your-bot)
  3. Optionally set the Branch, Git Username, and Git Access Token (required for private repos)
  4. If you have existing files on the server, select all files and delete them first
  5. Click Reinstall Server to pull the code from GitHub
  6. 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

  1. Upload your project files using one of the methods above
  2. Create a .env file with your bot token
  3. Click Start on the Console tab

FPS.ms automatically runs 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:

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

For more help, see our full troubleshooting guide or join the FPS.ms Discord server.