@webhikers/cli
v1.1.32
Published
CLI for creating and deploying webhikers projects
Readme
@webhikers/cli
CLI for creating and deploying webhikers projects on Hetzner/Coolify.
Prerequisites
Before using this CLI, you need:
- Hetzner Cloud Server with Coolify installed
- Wildcard DNS
*.preview.webhikers.devpointing to your server IP - GitHub CLI (
gh) installed and authenticated - Node.js >= 18
- SSH Key on your machine, added to the Hetzner server
Server Setup (one-time)
- Create a Hetzner CX23 server (Ubuntu 24.04)
- Add your SSH public key during server creation
- SSH into the server:
ssh -i ~/.ssh/your-key root@SERVER_IP - Install Coolify:
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash - Open
http://SERVER_IP:8000, create admin account - Enable API access: Settings → API Settings → API Access checkbox
- Create API token: Keys & Tokens → create token with root permissions
- Note your Server UUID: Servers → click server → UUID is in the URL
DNS Setup (one-time)
Add a wildcard A record for your domain:
| Type | Name | Value |
|------|------|-------|
| A | *.preview | SERVER_IP |
This makes every project available at project-name.preview.webhikers.dev.
Install
npm install -g @webhikers/cliSetup (once per machine)
webhikers configYou will be asked for:
| Prompt | Where to find it | |--------|-----------------| | Server IP | Hetzner Cloud Console → Server | | Coolify Port | Default: 8000 | | Coolify API Token | Coolify UI → Keys & Tokens | | Server UUID | Coolify UI → Servers → UUID in URL | | SSH User | Default: root | | SSH Key | Select from detected keys on your machine |
Config is saved to ~/.config/webhikers/config.json.
Create a new project
webhikers create my-projectThis will:
- Create a private GitHub repo from the
nextjs-vibe-startertemplate - Clone it and install dependencies
- Generate
.envwith a randomPAYLOAD_SECRET - Create a Coolify project with domain
my-project.preview.webhikers.dev - Set environment variables in Coolify
- Trigger the first deploy
After creation, add persistent volumes in Coolify UI:
- Open Coolify → Projects → select your project
- Go to Storages tab
- Add volume:
/app/data(SQLite database) - Add volume:
/app/public/media(uploaded images) - Redeploy the application
Then start local development:
cd my-project && npm run devArchitecture
~/.config/webhikers/
config.json ← Coolify token, server IP, SSH config (global)
ssh_key ← SSH private key (chmod 600)
project/
.env ← PAYLOAD_SECRET + SITE_URL (local dev, gitignored)
.deploy.json ← Server IP, domain, Coolify UUIDs (gitignored)- Local dev:
npm run dev→ localhost:3000 - Sync from prod:
npm run sync:pull(git pull + DB + media) - Deploy:
npm run sync:push(media push + git push → Coolify builds) - Coolify handles Docker build, Payload migrations, and seed on every deploy
Adding a team member
Your team member creates their own SSH key and sends you the public key (.pub file). Then:
ssh -i ~/.ssh/your-key root@SERVER_IP
echo "their-public-key-content" >> /root/.ssh/authorized_keysThey install the CLI and run webhikers config with the same server details.
Scaling
| Server | RAM | Capacity | |--------|-----|----------| | CX23 | 4 GB | 5-10 sites | | CX33 | 8 GB | 20-30 sites | | CX43 | 16 GB | 50-80 sites | | CX53 | 32 GB | 100-150 sites |
Upgrade via Hetzner Console (30 sec, no data loss). For 150+ sites, add a second server — Coolify manages multiple servers natively.
License
MIT
