Hostlane is a multi-tenant platform designed to make static site deployments as simple as a zip upload. It handles the heavy lifting of versioning, symlink-based rollbacks, and Nginx orchestration so you don't have to.
- Atomic Deployments: Instant rollbacks via symlink switching.
- Multi-tenant Architecture: Isolate sites and deployments by ID.
- Fault-Tolerant Uploads: Automatic recovery of interrupted deployments (handles worker crashes or server reboots).
- High-Performance Serving: Nginx-backed delivery with automated config management.
- Secure Reloads: Controlled Nginx reloads via a dedicated, root-owned helper script.
Hostlane splits concerns between a management API and a high-speed worker:
- API (Node.js/TS): The brains. Manages auth, site metadata, and Nginx templates.
- Worker (Golang): The muscle. Fast extraction and filesystem preparation for incoming deployments.
- Edge (Nginx): The face. Pure, optimized static file serving.
We use a predictable directory structure to manage site state:
/var/lib/hostlane/
├── config/ # Generated Nginx site configs (Staging)
└── sites/
└── site_<id>/
├── uploads/ # Deployment artifacts (.zip)
├── deployments/# Extracted versions
└── current -> deployments/deploy_<id>
- Push: Upload a
.zipvia the API. - Process: The Go worker extracts it to a unique deployment directory.
- Switch: The
currentsymlink is updated. Boom. You're live. - Rollback: Need to go back? Point the symlink to the previous folder. No downtime.
By default, Hostlane uses /var/lib/hostlane/ for deployments and configuration. You can override this by setting ROOT_STORAGE in your .env file.
You must create the directory and grant ownership to the user running the API server:
sudo mkdir -p /var/lib/hostlane/{sites,config}
sudo chown -R <app-user>:<app-user> /var/lib/hostlane/- sites/: Stores uploads and extracted deployments.
- config/: Acts as a staging area where the server generates Nginx configs before they are synced to the system.
The system requires a dedicated script to validate and reload Nginx. Copy it from the source to your local bin:
sudo cp scripts/hostlane-nginx-reload.sh /usr/local/bin/
sudo chmod +x /usr/local/bin/hostlane-nginx-reload.shThen, allow the app user to execute it without a password prompt by adding this to visudo:
<app-user> ALL=(root) NOPASSWD: /usr/local/bin/hostlane-nginx-reload.shHostlane expects a wildcard SSL configuration for site delivery. Create a snippet at /etc/nginx/snippets/ssl-wildcard.conf:
# /etc/nginx/snippets/ssl-wildcard.conf
ssl_certificate /path/to/your/fullchain.pem;
ssl_certificate_key /path/to/your/privkey.pem;Prerequisites:
- Node.js (v18+)
- Go (1.20+)
Run the build script from the project root:
# Make the script executable
chmod +x scripts/build.sh
# Run the build
./scripts/build.sh