Skip to Content
BytePanelBytePanel

Finish the script install

The steps to do after the Debian and Ubuntu install script finishes.

The install script downloads the latest panel release to /var/www/BytePanel, installs Bun, Redis and nginx, and builds the panel. These steps connect a database, start the panel and put it behind HTTPS.

Create the database

apt -y install postgresql
sudo -u postgres psql -c "CREATE USER bytepanel WITH PASSWORD 'change-me';"
sudo -u postgres psql -c "CREATE DATABASE bytepanel OWNER bytepanel;"

Configure the panel

Edit /var/www/BytePanel/apps/web/.env and set at least:

DATABASE_URL=postgresql://bytepanel:change-me@localhost:5432/bytepanel
REDIS_URL=redis://localhost:6379
BETTER_AUTH_SECRET=   # generate with: openssl rand -base64 32
BETTER_AUTH_URL=https://panel.example.com

See Configuration for every option.

Set up the database tables

cd /var/www/BytePanel/apps/web
bun run db:deploy

Run the panel as a service

/etc/systemd/system/bytepanel.service
[Unit]
Description=BytePanel
After=network.target postgresql.service redis-server.service

[Service]
WorkingDirectory=/var/www/BytePanel/apps/web
Environment=NODE_ENV=production
Environment=PORT=3000
ExecStart=/root/.bun/bin/bun run start
Restart=on-failure

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable --now bytepanel

Configure nginx

/etc/nginx/sites-available/bytepanel.conf
server {
    listen 80;
    server_name panel.example.com;
    client_max_body_size 100m;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_buffering off;
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
ln -s /etc/nginx/sites-available/bytepanel.conf /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx

Add HTTPS

apt -y install certbot python3-certbot-nginx
certbot --nginx -d panel.example.com

Create the admin account

Open your panel URL and sign up. The first account becomes the super admin.

Then add a node.

Edit on GitHub

On this page