Setup Docs

Step by step from an empty server to a running bot, dashboard or website. Choose your hosting and every section shows the matching commands.

Your hosting
Step 01

Before you start

This guide walks you through everything you need to run a bot, dashboard or website from us on your own server. Pick your type of hosting at the top, every section then shows the matching steps.

  1. VPS / root server (Linux): full control, recommended for bots with a dashboard or database. Ubuntu 22.04/24.04 or Debian 12.
  2. Windows Server: works fine for bots, but less common for websites. You connect via Remote Desktop.
  3. Bot hosting with a panel (Pterodactyl / Pelican): the easiest option. Node.js and restarts are handled by the panel.

You'll find everything specific to your project (start file, environment variables, ports) in the README.md we hand over with your files.

Linux VPS

Connect to your server via SSH. On Windows you can use the built-in terminal (PowerShell):

bash
ssh root@DEINE-SERVER-IP

Then bring the system up to date once:

bash
sudo apt update && sudo apt upgrade -y
Step 02

Create the Discord application

If we haven't set up the bot account for you, create it yourself in the Discord Developer Portal. You need the token for the next steps.

  1. Open discord.com/developers/applications and click New Application.
  2. Under Bot, click Reset Token and copy the token. Never share it with anyone.
  3. Still under Bot, enable the Privileged Gateway Intents listed in your README (usually Server Members and Message Content).
  4. Under OAuth2 → URL Generator, select the scopes bot and applications.commands, pick the permissions and open the generated link to invite the bot.

Anyone with your token controls your bot. If it ever leaks, click Reset Token immediately and update your .env.

Step 03

Install Node.js

Our bots and dashboards run on Node.js. We recommend the current LTS version (22).

Linux VPS

Install Node.js 22 from the official NodeSource repository:

bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs

Check that it worked:

bash
node -v
npm -v
Step 04

Set up and start the bot

Upload the files we gave you, install the packages, enter your token and start the bot.

Every project has a .env.example. Copy it to .env and fill in the values. At minimum:

.env
DISCORD_TOKEN=dein-bot-token
CLIENT_ID=deine-application-id
GUILD_ID=deine-server-id
Linux VPS

Create a folder and upload the files, for example with WinSCP or FileZilla (SFTP, same login as SSH):

bash
sudo mkdir -p /opt/bots/mein-bot
cd /opt/bots/mein-bot

Install packages, create the .env and build the bot:

bash
npm ci
cp .env.example .env
nano .env
npm run build

Start it once in the foreground to test it. If the bot shows up online in Discord, stop it with Ctrl + C:

bash
npm start
Step 05

Keep the bot running (PM2)

So the bot keeps running after you close the window, restarts after crashes and comes back after a server reboot.

Linux VPS
bash
sudo npm install -g pm2
cd /opt/bots/mein-bot
pm2 start dist/index.js --name mein-bot
pm2 save
pm2 startup

pm2 startup prints one more command. Copy it and run it, then the bot starts automatically after a reboot.

Useful commands:

bash
pm2 logs mein-bot      # Logs live ansehen
pm2 restart mein-bot   # neu starten
pm2 status             # alle Prozesse
Step 06

MySQL / MariaDB database

Only needed if your README mentions a database (e.g. for levels, economy or tickets). MariaDB is fully compatible with MySQL.

Afterwards, put the access details into your .env:

.env
DATABASE_URL=mysql://novex:starkes-passwort@localhost:3306/novex_bot
Linux VPS
bash
sudo apt install -y mariadb-server
sudo mysql_secure_installation

Open the database console and create a database plus a user for the bot:

bash
sudo mariadb
SQL
CREATE DATABASE novex_bot CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'novex'@'localhost' IDENTIFIED BY 'starkes-passwort';
GRANT ALL PRIVILEGES ON novex_bot.* TO 'novex'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Don't open port 3306 in your firewall. The bot connects locally, nobody else needs access.

Step 07

Nginx for dashboard & website

Nginx makes your dashboard or website reachable under your own domain. Point an A record of your domain to the server IP first.

Linux VPS
bash
sudo apt install -y nginx
sudo nano /etc/nginx/sites-available/dashboard

Dashboard (a Node.js app, here on port 3000) as a reverse proxy:

/etc/nginx/sites-available/dashboard
server {
    listen 80;
    server_name dashboard.deine-domain.de;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Website (static files, uploaded to /var/www/website) instead:

/etc/nginx/sites-available/website
server {
    listen 80;
    server_name deine-domain.de www.deine-domain.de;
    root /var/www/website;
    index index.html;

    location / {
        try_files $uri $uri/ /index.html;
    }
}

Enable the config, test it and reload Nginx:

bash
sudo ln -s /etc/nginx/sites-available/dashboard /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
Step 08

HTTPS with Let's Encrypt

A free SSL certificate so your dashboard and website load via https://. Nginx must already be set up.

Linux VPS
bash
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d dashboard.deine-domain.de

Certbot adjusts your Nginx config automatically and renews the certificate on its own. You can test the renewal:

bash
sudo certbot renew --dry-run
Step 09

Firewall

Only open what you really need: SSH for you and ports 80/443 for the website. Bots don't need any open port.

Linux VPS
bash
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable
sudo ufw status

Always allow OpenSSH before ufw enable, otherwise you lock yourself out.

Step 10

Updates & troubleshooting

How to install a new version from us and what the most common error messages mean.

  1. Used disallowed intents: enable the intents from your README in the Developer Portal under Bot.
  2. An invalid token was provided: the token in .env is wrong or was reset. Copy a new one.
  3. Cannot find module: packages are missing. Run npm ci (Linux/Windows) or restart the server (panel).
  4. ER_ACCESS_DENIED_ERROR: user or password in DATABASE_URL doesn't match the database.
  5. EADDRINUSE: the port is already taken. Change PORT in .env or stop the other program.
  6. Slash commands don't show up: restart Discord (Ctrl + R). Global commands can take a moment.
Linux VPS

Upload the new files (keep your .env), then:

bash
cd /opt/bots/mein-bot
npm ci
npm run build
pm2 restart mein-bot