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.
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.
- VPS / root server (Linux): full control, recommended for bots with a dashboard or database. Ubuntu 22.04/24.04 or Debian 12.
- Windows Server: works fine for bots, but less common for websites. You connect via Remote Desktop.
- 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.
Connect to your server via SSH. On Windows you can use the built-in terminal (PowerShell):
ssh root@DEINE-SERVER-IPThen bring the system up to date once:
sudo apt update && sudo apt upgrade -yCreate 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.
- Open
discord.com/developers/applicationsand click New Application. - Under Bot, click Reset Token and copy the token. Never share it with anyone.
- Still under Bot, enable the Privileged Gateway Intents listed in your README (usually Server Members and Message Content).
- Under OAuth2 → URL Generator, select the scopes
botandapplications.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.
Install Node.js
Our bots and dashboards run on Node.js. We recommend the current LTS version (22).
Install Node.js 22 from the official NodeSource repository:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejsCheck that it worked:
node -v
npm -vSet 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:
DISCORD_TOKEN=dein-bot-token
CLIENT_ID=deine-application-id
GUILD_ID=deine-server-idCreate a folder and upload the files, for example with WinSCP or FileZilla (SFTP, same login as SSH):
sudo mkdir -p /opt/bots/mein-bot
cd /opt/bots/mein-botInstall packages, create the .env and build the bot:
npm ci
cp .env.example .env
nano .env
npm run buildStart it once in the foreground to test it. If the bot shows up online in Discord, stop it with Ctrl + C:
npm startKeep the bot running (PM2)
So the bot keeps running after you close the window, restarts after crashes and comes back after a server reboot.
sudo npm install -g pm2
cd /opt/bots/mein-bot
pm2 start dist/index.js --name mein-bot
pm2 save
pm2 startuppm2 startup prints one more command. Copy it and run it, then the bot starts automatically after a reboot.
Useful commands:
pm2 logs mein-bot # Logs live ansehen
pm2 restart mein-bot # neu starten
pm2 status # alle ProzesseMySQL / 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:
DATABASE_URL=mysql://novex:starkes-passwort@localhost:3306/novex_botsudo apt install -y mariadb-server
sudo mysql_secure_installationOpen the database console and create a database plus a user for the bot:
sudo mariadbCREATE 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.
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.
sudo apt install -y nginx
sudo nano /etc/nginx/sites-available/dashboardDashboard (a Node.js app, here on port 3000) as a reverse proxy:
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:
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:
sudo ln -s /etc/nginx/sites-available/dashboard /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginxHTTPS with Let's Encrypt
A free SSL certificate so your dashboard and website load via https://. Nginx must already be set up.
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d dashboard.deine-domain.deCertbot adjusts your Nginx config automatically and renews the certificate on its own. You can test the renewal:
sudo certbot renew --dry-runFirewall
Only open what you really need: SSH for you and ports 80/443 for the website. Bots don't need any open port.
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable
sudo ufw statusAlways allow OpenSSH before ufw enable, otherwise you lock yourself out.
Updates & troubleshooting
How to install a new version from us and what the most common error messages mean.
Used disallowed intents: enable the intents from your README in the Developer Portal under Bot.An invalid token was provided: the token in.envis wrong or was reset. Copy a new one.Cannot find module: packages are missing. Runnpm ci(Linux/Windows) or restart the server (panel).ER_ACCESS_DENIED_ERROR: user or password inDATABASE_URLdoesn't match the database.EADDRINUSE: the port is already taken. ChangePORTin.envor stop the other program.- Slash commands don't show up: restart Discord (
Ctrl + R). Global commands can take a moment.
Upload the new files (keep your .env), then:
cd /opt/bots/mein-bot
npm ci
npm run build
pm2 restart mein-bot