Skip to content

Installation

Marc Pope edited this page Feb 24, 2026 · 5 revisions

Installation

BBS can be installed two ways:

Both methods support local and Remote Storage (SSH) repository storage.


Standard Installation

This section walks through installing BBS on a fresh Ubuntu Server.

Prerequisites

Before installing BBS, ensure you have:

  1. Fresh Ubuntu Server 22.04 LTS or newer

    • Minimal or standard installation
    • At least 2GB RAM, 50GB disk (see System Requirements for detailed requirements)
  2. DNS A Record pointing to your server's IP address

    • Example: backups.example.com → 1.2.3.4
    • Required for automatic SSL certificate generation
    • Not required for LAN-only installations (see LAN Installation Notes below)
  3. Root or sudo access to the server

  4. Ports 22, 80, and 443 open in your firewall

Step 1: Download and Run the Installer

The BBS installer is a single bash script that automates the entire installation process.

Basic Installation

For a standard internet-connected installation with automatic SSL:

curl -sSL https://raw.githubusercontent.com/marcpope/borgbackupserver/main/bin/bbs-install | sudo bash

The installer will:

  • Detect your server's hostname from DNS
  • Install all required software packages
  • Configure Apache with SSL via Let's Encrypt
  • Set up MySQL
  • Create the BBS directory structure
  • Configure cron jobs for scheduled backups

Installation with Custom Hostname

If you want to specify a different hostname:

curl -sSL https://raw.githubusercontent.com/marcpope/borgbackupserver/main/bin/bbs-install -o bbs-install
chmod +x bbs-install
sudo ./bbs-install --hostname backups.example.com

LAN-Only Installation (No SSL)

For servers on a private network without a public DNS name:

curl -sSL https://raw.githubusercontent.com/marcpope/borgbackupserver/main/bin/bbs-install -o bbs-install
chmod +x bbs-install
sudo ./bbs-install --no-ssl

This skips Let's Encrypt SSL setup. You'll access BBS via HTTP instead of HTTPS.

What the Installer Does

The bbs-install script performs 10 automated steps:

1. System Package Installation

Installs required packages via apt:

  • php8.1 and extensions (pdo_mysql, mbstring, curl, xml, zip, intl, gd, ssh2)
  • mysql-server (MySQL 8.0)
  • apache2 (with mod_rewrite, mod_ssl)
  • borgbackup
  • python3 and python3-pip
  • memcached
  • rclone
  • certbot (for SSL certificates)

2. MySQL Setup

  • Secures MySQL installation
  • Creates bbs database (if not exists)
  • Configures authentication

3. Apache Configuration

  • Creates VirtualHost configuration at /etc/apache2/sites-available/bbs.conf
  • Enables required Apache modules (rewrite, ssl, headers)
  • Configures document root at /var/www/bbs/public

4. PHP Configuration

  • Configures php.ini settings for BBS
  • Sets memory limits, upload sizes, timezone
  • Enables required extensions

5. Composer Installation

  • Installs Composer globally
  • Runs composer install in /var/www/bbs to install PHP dependencies

6. BorgBackup Installation

  • Installs latest BorgBackup from repositories
  • Verifies installation

7. SSL Certificate (if enabled)

  • Runs Certbot to obtain Let's Encrypt certificate
  • Configures automatic renewal via cron
  • Updates Apache to use HTTPS

8. SSH Helper Configuration

  • Creates SSH wrapper script for BorgBackup
  • Configures SSH keys for agent-server communication

9. Cron Job Setup

  • Installs cron job to run /var/www/bbs/scheduler.php every minute
  • This drives the backup job queue and scheduled backups

10. Directory Structure

Creates BBS directories:

/var/www/bbs/          # Application root
/var/www/bbs/config/   # Configuration files
/var/bbs/home/         # Borg repository storage (default)
/var/log/bbs/          # Log files

Sets appropriate ownership and permissions.

Step 2: Setup Wizard

Setup Wizard

After the installer completes, access the setup wizard in your web browser:

https://backups.example.com/setup

(Or http://your-server-ip/setup for LAN installations)

The setup wizard guides you through initial configuration:

Page 1: Welcome & System Check

The wizard verifies:

  • PHP version (8.1+)
  • Required PHP extensions
  • MySQL connectivity
  • Directory permissions
  • BorgBackup installation

All checks must pass (green checkmarks) before proceeding.

If checks fail:

  • Red X indicates a problem
  • Hover over the status icon for details
  • Most issues indicate the installer didn't complete successfully; try running it again

Click Next to continue.

Page 2: Database Connection

Database

Enter MySQL connection details:

  • Database Host: localhost (default)
  • Database Name: bbs (default, created by installer)
  • Database Username: root (or a dedicated MySQL user)
  • Database Password: Your MySQL password

The wizard will test the connection. If successful, it creates any missing tables.

Troubleshooting:

  • If connection fails, verify MySQL is running: sudo systemctl status mysql
  • Check credentials: sudo mysql -u root -p
  • Ensure the bbs database exists: sudo mysql -e "SHOW DATABASES;"

Click Next to continue.

Page 3: Administrator Account

admin account setup

Create the primary administrator account:

  • Name: Your full name
  • Email: Your email address (used for login)
  • Password: Choose a strong password (min. 8 characters)
  • Confirm Password: Re-enter password

This account will have full administrative access to BBS.

Security Note: Enable Two-Factor Authentication after setup for enhanced security.

Click Next to continue.

Page 4: Storage Path & Server Hostname

Storage Screen

Configure storage and server settings:

  • Repository Storage Path: /var/bbs/home (default)

  • Server Hostname: backups.example.com (auto-detected from your DNS/install)

    • Used by agents to connect to the server
    • Must be accessible from all client machines
    • Include https:// prefix (or http:// for LAN installations)

Click Next to continue.

Page 5: Final Setup

Review and Install Screen

The wizard performs final setup:

  1. Imports Database Schema - Creates all required tables from schema.sql
  2. Creates Configuration File - Generates /var/www/bbs/config/.env with your settings
  3. Generates APP_KEY - Creates a unique encryption key for sessions and data

A progress indicator shows each step. This takes 10-30 seconds.

When complete, you'll see a success message with a button to log in.

Setup Complete

Click Go to Login to access BBS.

Post-Installation

First Login

  1. Navigate to your BBS hostname (e.g., https://backups.example.com)
  2. Log in with the administrator email and password you created in Step 3
  3. You'll see the BBS dashboard (initially empty)

Empty Dashboard

Add Your First Client

See the Getting Started guide for a quick walkthrough of:

  • Adding a client
  • Installing the agent
  • Creating a repository
  • Configuring your first backup plan

Verify Cron Job (if having problems)

Ensure the BBS scheduler is running:

sudo crontab -l | grep scheduler

You should see:

* * * * * php /var/www/bbs/scheduler.php >> /var/log/bbs/scheduler.log 2>&1

This job runs every minute and processes the backup queue.

Check Logs

Monitor installation and initial operation:

sudo tail -f /var/log/bbs/scheduler.log
sudo tail -f /var/log/apache2/error.log

LAN Installation Notes

For BBS servers on isolated LANs without public DNS or internet access:

Installation

Use the --no-ssl flag:

sudo ./bbs-install --no-ssl

This skips:

  • Let's Encrypt SSL certificate generation
  • Certbot installation
  • HTTPS configuration

Accessing BBS

Access via HTTP instead of HTTPS:

http://192.168.1.100/setup

Use the server's IP address or internal hostname.

Agent Setup

When installing agents on LAN clients, use the HTTP URL or just copy the link from the Install Tab of the Client Detail page.

sudo python3 bbs-agent.py --server http://192.168.1.100 --api-key YOUR_API_KEY

Security Considerations

Without SSL, all communication (including passwords and backup data) is unencrypted. Only use --no-ssl on trusted, isolated networks.

For better security on LANs:

  1. Generate a self-signed certificate
  2. Configure Apache manually for HTTPS
  3. Update agent configurations to trust the self-signed cert

(This is an advanced configuration not covered by the automated installer.)

Troubleshooting

Installer Fails During Package Installation

Symptom: apt errors, package not found

Solution:

sudo apt update
sudo apt upgrade
sudo ./bbs-install

Setup Wizard Shows "Permission Denied" Errors

Symptom: Red X on directory permission checks

Solution:

sudo chown -R www-data:www-data /var/www/bbs
sudo chown -R www-data:www-data /var/bbs/home
sudo chmod -R 755 /var/www/bbs

Can't Access Setup Wizard (404 Error)

Symptom: Browser shows "Not Found"

Solution:

  1. Verify Apache is running: sudo systemctl status apache2
  2. Check Apache config: sudo apache2ctl configtest
  3. Restart Apache: sudo systemctl restart apache2
  4. Check /var/www/bbs/public exists and contains index.php

MySQL Connection Fails in Setup Wizard

Symptom: "Could not connect to database" error

Solution:

  1. Verify MySQL is running: sudo systemctl status mysql
  2. Test manual connection: sudo mysql -u root -p
  3. Create database manually if needed:
    sudo mysql -e "CREATE DATABASE IF NOT EXISTS bbs;"

See Troubleshooting for more common issues.

Next Steps

Once installation is complete:

  1. Read the Getting Started guide
  2. Configure Settings (SMTP, timezone, etc.)
  3. Set up Two-Factor Authentication
  4. Add clients and create backup plans
  5. Optionally configure Remote Storage to back up directly to remote SSH hosts like rsync.net, BorgBase, or Hetzner

Uninstallation

To completely remove BBS:

sudo rm -rf /var/www/bbs
sudo rm -rf /var/bbs
sudo rm /etc/apache2/sites-available/bbs.conf
sudo a2dissite bbs
sudo systemctl reload apache2
sudo mysql -e "DROP DATABASE bbs;"
sudo crontab -l | grep -v scheduler | sudo crontab -

Warning: This deletes all backups and configuration. Export any data you need first.

Clone this wiki locally