Self-Hosting
Requirements
- Node.js 20+
- Linux server with systemd (for production)
Build & run
git clone https://github.mieweb.com/webchart/loco.git
cd loco
npm install
npm run build # build the Svelte dashboard
npm start # starts Fastify on :6101
Dashboard available at http://<your-ip>:6101/dashboard/
Deploy with systemd
The included deploy.sh script handles everything:
chmod +x deploy.sh
./deploy.sh install # build + install systemd service + start
./deploy.sh status # show status + recent logs
./deploy.sh restart # restart service
./deploy.sh logs # tail live logs
./deploy.sh uninstall # stop + remove service
Reverse proxy (Nginx)
server {
listen 80;
server_name loco.yourdomain.com;
location / {
proxy_pass http://127.0.0.1:6101;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Base path
If running under a subpath (e.g. /loco/), set:
BASE_PATH=/loco
All routes, dashboard, and CDN URLs will be prefixed automatically.
Data directory
LOCO_DATA_DIR=/var/loco/data # absolute path recommended for production
The SQLite database and backups are stored here. Back this directory up regularly.
Backups
npm run backup
# or: tsx server/scripts/backup.ts
Creates a timestamped .zip of the database in the data directory.