Getting Started
Installation
Install HostFn and its prerequisites.
Install HostFn
HostFn is published on npm and can be installed globally:
npm install -g hostfnVerify the installation:
hostfn --versionPrerequisites
Before using HostFn, make sure you have the following:
Local Machine
| Requirement | Version | Check |
|---|---|---|
| Node.js | 18+ | node --version |
| rsync | Any | rsync --version |
| SSH key | — | ls ~/.ssh/id_* |
Installing rsync:
# macOS
brew install rsync
# Ubuntu/Debian
sudo apt-get install rsync
# Windows (via WSL)
sudo apt-get install rsyncRemote Server
You need a Linux server with:
- SSH access configured with key authentication
- Root or sudo access (for the initial server setup)
- Ubuntu 20.04+, Debian 11+, CentOS 8+, or similar Linux distribution
HostFn will install everything else (Node.js, PM2, Nginx) during hostfn server setup.
SSH Key Setup
If you don't already have an SSH key:
# Generate a new SSH key
ssh-keygen -t ed25519 -C "your-email@example.com"
# Copy it to your server
ssh-copy-id ubuntu@your-server.comHostFn looks for SSH keys in this order:
HOSTFN_SSH_KEYenvironment variable (base64-encoded, for CI/CD)- SSH agent (
SSH_AUTH_SOCK) ~/.ssh/id_ed25519~/.ssh/id_ecdsa~/.ssh/id_rsa
Next Steps
Once installed, continue to Quickstart to initialize your first project.