Skip to main content

Manual Installation

If you prefer not to use Docker, you can run Bloqd directly with Node.js.

Prerequisites

  • Node.js 20+ (LTS recommended)
  • npm 10+
  • Git

Install Node.js

Ubuntu/Debian:

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs

RHEL/CentOS/Rocky:

curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo bash -
sudo dnf install -y nodejs

Verify installation:

node --version  # Should be v20.x.x
npm --version # Should be v10.x.x

Step 1: Clone Repository

git clone https://github.com/clusterzx/bloqd-server.git
cd bloqd-server

Step 2: Install Dependencies

Install backend dependencies:

npm install

Build the frontend:

cd web
npm install
npm run build
cd ..

Step 3: Configure Environment

cp .env.example .env

Edit .env:

NODE_ENV=production
PORT=3000
HOST=0.0.0.0
DATABASE_PATH=./data/bloqd.db
API_KEY_SALT=your-random-32-character-salt

Create the data directory:

mkdir -p data

Step 4: Start Bloqd

Development Mode

npm run dev

Production Mode

npm start

Step 5: Create Systemd Service

For production, run Bloqd as a systemd service:

sudo nano /etc/systemd/system/bloqd.service
/etc/systemd/system/bloqd.service
[Unit]
Description=Bloqd - Fail2ban Management Server
After=network.target

[Service]
Type=simple
User=bloqd
Group=bloqd
WorkingDirectory=/opt/bloqd
ExecStart=/usr/bin/node /opt/bloqd/src/index.js
Restart=on-failure
RestartSec=10
StandardOutput=journal
StandardError=journal
Environment=NODE_ENV=production

[Install]
WantedBy=multi-user.target

Create the bloqd user:

sudo useradd -r -s /bin/false bloqd
sudo chown -R bloqd:bloqd /opt/bloqd

Enable and start the service:

sudo systemctl daemon-reload
sudo systemctl enable bloqd
sudo systemctl start bloqd

Check status:

sudo systemctl status bloqd
journalctl -u bloqd -f

Updating

cd /opt/bloqd
git pull
npm install
cd web && npm install && npm run build && cd ..
sudo systemctl restart bloqd

Next Steps