CtrlPanel

Getting Started

Quick guide to install and set up CtrlPanel.gg on your VPS.

Getting Started with CtrlPanel.gg

This guide will help you quickly set up CtrlPanel.gg on your VPS.

Ensure you have basic Linux and database knowledge before proceeding.

Prerequisites

  • Node.js v18.x or higher
  • MySQL 8.x or MariaDB 10.2+
  • Nginx
  • Git

Installation

Clone and Configure

# Clone the repository
git clone https://github.com/AVMG20/ctrlpanel.git /var/www/ctrlpanel
cd /var/www/ctrlpanel
 
# Install dependencies
npm install
 
# Set up environment
cp .env.example .env
nano .env

Update .env with your database credentials and domain.

Database and Build

# Set up database
mysql -u root -p -e "CREATE DATABASE ctrlpanel;"
npx prisma migrate deploy
 
# Build the app
npm run build

Make sure to update the DATABASE_URL in .env with your database credentials.

Nginx Configuration

Basic example for Nginx configuration.

Create /etc/nginx/sites-available/ctrlpanel.conf:

server {
    listen 80;
        server_name <yourdomain.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;
        }
}

Enable and restart Nginx:

sudo ln -s /etc/nginx/sites-available/ctrlpanel.conf /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl restart nginx

SSL (Optional)

You can secure your site with SSL using Certbot if you haven't already.

sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d yourdomain.com

Process Management

# Install PM2
sudo npm install -g pm2
 
# Start the app
pm2 start npm --name "ctrlpanel" -- start
 
# Set up auto-start
pm2 startup systemd
sudo env PATH=$PATH:/usr/bin pm2 startup systemd -u $USER --hp $HOME
pm2 save

Wrapping Up

Your CtrlPanel.gg should now be live at https://yourdomain.com.

For troubleshooting:

  • Check app logs: pm2 logs ctrlpanel
  • Check Nginx logs: sudo tail -f /var/log/nginx/error.log

Remember to rebuild and restart after code changes:

npm run build
pm2 restart ctrlpanel

For more information, visit the Next.js docs and Pterodactyl docs.

On this page