Standalone Linux & Systemd (Without Docker)
For hosting environments running directly on the Linux host OS with systemd and standalone services.
Overview & Purpose
This guide is strictly for standalone deployments directly on Ubuntu/Debian bare-metal or cloud VPS instances where you choose NOT to use Docker containers. The JChat server process is supervised directly by Linux systemd, while PostgreSQL 18 and Redis 7 are managed as standalone host services or external cloud databases (e.g. AWS RDS).
Host Prerequisites
Before configuring systemd, ensure the host OS has required runtimes and services running:
1. Bun 1.4.0+ Runtime
Install Bun on the host machine: curl -fsSL https://bun.sh/install | bash
curl -fsSL https://bun.sh/install | bash2. Standalone PostgreSQL 18+ & Redis 7+
Install and enable local database services or prepare external connection URLs:
sudo apt update && sudo apt install -y postgresql postgresql-contrib redis-server
sudo systemctl enable --now postgresql redis-server3. Deploy Pre-Compiled Standalone Bundle
Download your pre-compiled standalone distribution bundle (jchat-standalone-vX.Y.Z.zip) from your JChat Store Dashboard (under Purchases > Standalone (.zip)) and extract it to your deployment directory (e.g. /var/www/jchat):
sudo mkdir -p /var/www/jchat
sudo chown -R $USER:$USER /var/www/jchat
unzip jchat-standalone-vX.Y.Z.zip -d /var/www/jchatSystemd Service Configuration
Create a systemd unit file at /etc/systemd/system/jchat.service to keep JChat running 24/7 and automatically restart on reboot:
[Unit]
Description=JChat Enterprise Server (Standalone)
After=network.target postgresql.service redis.service
[Service]
Type=simple
User=jchat
WorkingDirectory=/var/www/jchat
ExecStart=/usr/local/bin/bun run start
Restart=always
RestartSec=5
Environment=NODE_ENV=production
EnvironmentFile=/var/www/jchat/.env
# Security Hardening
NoNewPrivileges=true
ProtectSystem=full
LimitNOFILE=65536
[Install]
WantedBy=multi-user.targetEnable & Start Service
Reload the systemd daemon, enable auto-start on boot, and verify the service status:
sudo systemctl daemon-reload
sudo systemctl enable --now jchat
sudo systemctl status jchat