> ## Documentation Index
> Fetch the complete documentation index at: https://docs.heartbreakhotel.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Manual install with nginx

> Skip this page if you used the [auto install](/nexora-dashboard/getting-started/auto-install). Use this if you want full control or already have nginx configured.

Skip this page if you used the [auto install](/nexora-dashboard/getting-started/auto-install). Use this if you want full control or already have nginx configured.

## 1. Install dependencies

Debian / Ubuntu:

```bash theme={null}
sudo apt update
sudo apt install -y curl unzip nginx certbot python3-certbot-nginx
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -
sudo apt install -y nodejs
```

Verify:

```bash theme={null}
node --version    # should print v20.x or higher
nginx -v
certbot --version
```

## 2. Extract the release ZIP

Upload `nexora-dashboard-vX.X.X.zip` to the server, then:

```bash theme={null}
cd /home
sudo unzip /path/to/nexora-dashboard-v*.zip
sudo mv nexora-dashboard-v* fivem
cd fivem
sudo npm ci --omit=dev
```

The release already contains `dist/server/` and `dist/client/`. You do not need to build anything.

## 3. Create `.env`

Copy the example and edit it:

```bash theme={null}
sudo cp .env.example .env
sudo nano .env
```

See [Environment variables](/nexora-dashboard/getting-started/env-vars) for what every field means. At minimum fill in `JWT_SECRET`, `FIVEM_API_KEY`, and all `DB_*` values.

Generate strong secrets:

```bash theme={null}
openssl rand -hex 32
```

Lock down permissions:

```bash theme={null}
sudo chmod 600 .env
```

## 4. nginx config

Create `/etc/nginx/sites-available/nexora-dashboard`:

```nginx theme={null}
map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

server {
    listen 80;
    server_name dash.yourdomain.com;

    client_max_body_size 5g;

    location /nui-ws {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header Host $host;
        proxy_read_timeout 86400;
        proxy_send_timeout 86400;
    }

    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_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;
        proxy_read_timeout 86400;
        proxy_send_timeout 86400;
    }
}
```

Replace `dash.yourdomain.com` with your actual domain.

Enable + reload:

```bash theme={null}
sudo ln -s /etc/nginx/sites-available/nexora-dashboard /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
```

## 5. Get SSL certificate

```bash theme={null}
sudo certbot --nginx -d dash.yourdomain.com
```

Certbot auto-edits your nginx config to add HTTPS and HTTP to HTTPS redirect. Renewal runs automatically (test with `certbot renew --dry-run`).

## 6. Create systemd service

Create `/etc/systemd/system/nexora-dashboard.service`:

```ini theme={null}
[Unit]
Description=Nexora Dashboard
After=network.target mysql.service mariadb.service
Wants=network-online.target

[Service]
Type=simple
User=root
WorkingDirectory=/home/fivem
ExecStart=/usr/bin/node dist/server/index.js
Restart=on-failure
RestartSec=5
EnvironmentFile=/home/fivem/.env
StandardOutput=journal
StandardError=journal
SyslogIdentifier=nexora-dashboard

[Install]
WantedBy=multi-user.target
```

Enable + start:

```bash theme={null}
sudo systemctl daemon-reload
sudo systemctl enable --now nexora-dashboard
sudo systemctl status nexora-dashboard
```

Follow logs:

```bash theme={null}
journalctl -u nexora-dashboard -f
```

## 7. Verify

Open `https://dash.yourdomain.com` in your browser. You should see the onboarding screen. Continue at [First login](/nexora-dashboard/getting-started/first-login).

## Common gotchas

* **Port 3000 already in use**: change `PORT` in `.env` and update `proxy_pass` in nginx.
* **502 Bad Gateway**: the Node service is not running. Run `systemctl status nexora-dashboard` and read the log.
* **SSL fails**: your domain DNS is not pointing at this server yet. Wait and retry.
* **WebSocket disconnects**: make sure the `/nui-ws` block above is present in your nginx config.
