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

# Installation

> Installation guide for RoadBackup Discord Bot

## Requirements

* **Node.js v22+** - [Download here](https://nodejs.org/)
* Discord Bot Token
* Server with sufficient permissions

## Installation Guide

The controller is only accessible via localhost.

### Windows Installation

Start the bot with `node index.js`. For 24/7 operation:

```bash theme={null}
npm install -g pm2
pm2 start index.js --name "roadbackup"
pm2 startup
pm2 save
```

### Linux Installation

Create SSH tunnel for localhost access (optional for controller, can also use slash commands):

```bash theme={null}
ssh -L 3030:localhost:3030 youruser@yourip
```

Execute in the same folder as the bot. For 24/7 operation:

```bash theme={null}
sudo npm install -g pm2
pm2 start index.js --name "roadbackup"
pm2 startup systemd
sudo env PATH=$PATH:/usr/bin pm2 startup systemd -u $USER --hp $HOME
pm2 save
sudo systemctl enable pm2-$USER
sudo systemctl start pm2-$USER
```

#### Alternative: Systemd Service

Create service file:

```bash theme={null}
sudo nano /etc/systemd/system/roadbackup.service
```

Add configuration:

```ini theme={null}
[Unit]
Description=RoadBackup
After=network.target

[Service]
ExecStart=/usr/bin/node /yourpath/mysqlbackuperv2
WorkingDirectory=/yourpath/mysqlbackuperv2
Restart=always
User=yourusername
Environment=NODE_ENV=production

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

Enable and start service:

```bash theme={null}
sudo systemctl daemon-reload
sudo systemctl enable roadbackup
sudo systemctl start roadbackup
```
