Any VPS running Ubuntu 20.04 or newer will work for hosting the Capinetta RP Bot System. A 1 vCPU / 2 GB RAM droplet (~$5/mo) is sufficient for small communities; 2 vCPU / 4 GB RAM is recommended for larger servers with heavier ticket and moderation activity. This guide is written for Ubuntu 22.04 LTS and has been tested on DigitalOcean, Linode, and Hetzner.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Capinetta-RP/capinetta-discord-bot/llms.txt
Use this file to discover all available pages before exploring further.
capinetta-bot# Connect as root
ssh root@YOUR_SERVER_IP
# Create a dedicated non-root user
adduser capinetta
usermod -aG sudo capinetta
# Switch to the new user for all subsequent steps
su - capinetta
# Node.js v20 LTS
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs mariadb-server git
# PM2 process manager (global)
sudo npm install -g pm2
# Verify
node --version # v20.x.x
# Run the interactive security wizard
sudo mysql_secure_installation
# Create the application database and user in one command
sudo mysql -u root -e "
CREATE DATABASE capi_netta;
CREATE USER 'capi'@'localhost' IDENTIFIED BY 'strong_pass';
GRANT ALL PRIVILEGES ON capi_netta.* TO 'capi'@'localhost';
FLUSH PRIVILEGES;
"
# Enable MariaDB on boot
sudo systemctl enable mariadb
cd ~
git clone https://github.com/Capinetta-RP/capinetta-discord-bot.git
cd capinetta-discord-bot
# Copy the example env file and fill in your values
cp .env.example .env
nano .env
# Install dependencies (also generates Prisma client via postinstall)
npm install
# Push the schema to the database
npx prisma db push
# Deploy slash commands to Discord, then start both bots
npm run deploy && npm run prod
# Persist the process list across reboots
pm2 startup && pm2 save
When you run
pm2 startup, follow the printed instruction to register the init script with systemd (copy and run the sudo env PATH=... command it outputs).server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
sudo ln -s /etc/nginx/sites-available/capinetta /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
Certbot will automatically modify the Nginx config to handle HTTPS and set up auto-renewal. After this completes, update your
.env:DASHBOARD_CALLBACK_URL=https://your-domain.com/auth/discord/callback
HTTPS_ENABLED=false # Nginx handles TLS termination; the app stays on HTTP internally
For local HTTPS testing without a domain, the project includes a
generate-ssl-certs.js script that creates self-signed certificates using OpenSSL. Run npm run gen-ssl to generate certs/key.pem and certs/cert.pem, then set HTTPS_ENABLED=true in .env. These self-signed certs are for development only — use Let’s Encrypt for production.