Aral Balkan

Mastodon icon RSS feed icon

Indie Web Server 7.1.0: Launch a live secure static site with a single command

Screenshot of terminal: ~/ind.ie/hypha/web-server   master  web-server --live test/site 💖 Indie Web Server v7.1.0 😈 Launched as daemon on https://aral2.hypha.dev 😈 Installed for auto-launch at startup.

Deploying a secure static web server now takes just one command and a few seconds.

You have: a VPS with a domain name pointing to it and Node.js installed.

You want: to deploy a secure, live static site.

You do: npm i -g @ind.ie/web-server && web-server --live

Hit your domain name in a browser.

The first time you do it, it will take a few seconds to load as your Let’s Encrypt certificates are being provisioned for you by ACME TLS. Then you’re up and running (with an A on the SSL Labs SSL Server Test), serving a static site from the folder you were in when you issued the command.

Your web server is running as a daemon thanks to the seamlessly integrated pm2 process manager. If you restart the server, your web site will be launched automatically. Ditto if it should crash, etc.

Screenshot of the pm2 process monitor showing the web-server running

Monitor your live server via the seamlessly integrated pm2 process manager.

To monitor it:

web-server --monitor

To view the logs:

web-server --logs

To take it offline and stop it from launching at startup:

web-server --offline

For full details, please see the relevant section in the documentation.

Where’s all this heading? Read this.