Discord Bots

Installation

bbassie Aug 24, 2025 Updated Mar 17, 2026 Edited by CanerAkar

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:
  1. An FPS.ms accountcreate your first server and select a Discord bot package (Python or Node.js)
  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

MethodBest forHow it works
**GitHub repository**Active developmentEnter your repo details in the **Startup** tab, then press **Reinstall Server**
**SFTP upload**Large projectsUpload your project folder via [SFTP](/getting-started/connecting-to-sftp/)
**Panel file manager**Quick editsCreate 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

FeaturePython (discord.py)Node.js (discord.js)
Entry point`app.py` (configurable in Startup)`index.js` (configurable in Startup)
Dependencies`requirements.txt``package.json`
LanguagePythonJavaScript
Best forBeginners, data-heavy botsJS developers, large-scale bots
Community sizeLargeVery large
Slash commandsSupportedSupported

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:
ErrorCauseFix
`No such file or directory: app.py`Missing entry pointCreate `app.py` in the root directory
`ModuleNotFoundError: No module named 'discord'`Missing dependenciesCreate `requirements.txt` with `discord.py`
`TOKEN_INVALID`Wrong or missing bot tokenCheck your token in the `.env` file
Bot starts but goes offlineCode error or crash loopCheck 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.

Was this article helpful?