Skip to content
The API server for staticland! Static site hosting with SSL via Let's Encrypt
JavaScript HTML CSS Shell
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.


A secure home for your static sites.


  • One command to deploy a site.
  • Automatic SSL using Let's Encrypt.
  • Use any static site generator.
  • MIT licensed. Host it yourself. Use it how you want.


Installing on Ubuntu 16.10

Install system dependencies

sudo apt-get update
sudo apt-get install git bc build-essential nginx
sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048

Install nvm & node

curl -o- | bash
. ~/.bashrc
nvm install v6

Install certbot

chmod a+x ./certbot-auto

Install staticland-api

git clone
cd staticland-api
npm i

staticland config

Copy the example config file and make changes if needed:

cp example.config.js config.js

set NODE_ENV to production

In the .bashrc file of the user that will run the staticland server add:

export NODE_ENV="production"

nginx config

You can use the nginx config files found in staticland/config.

Make sure to:

  • replace any references to to the hostname you're using
  • change directory references if you place staticland or the sites in a different directory

Create cert for api server

cd ~
./certbot-auto certonly --standalone --agree-tos --redirect --duplicate --text --email -d

restart nginx

sudo service nginx restart

install forever

npm i -g forever

set the STATICLAND_SECRET environment variable

export STATICLAND_SECRET=SomethingMoreSecretThanThis

start the staticland server

forever start index.js

renewing certificates

crontab -e
add a cron job for renewing site certificates
00 00 * * * node /home/ubuntu/staticland-api/bin/renew

Sites will get cert renewals based on the renewEvery value of the config.js file. The default value of 30 means certs will be renewed every 30 days.

add a con job for renewing the api server certificate
* 00 * * 1 /home/ubuntu/certbot-auto renew --standalone --pre-hook "service nginx stop" --post-hook "service nginx start" --quiet

Every Monday at midnight certbot will check to see if the certificate needs to be renewed.



You can’t perform that action at this time.