If only everything was as easy as setting up your own personal web server.
- Provision a Linux VPS and point your domain name to it (the hardest step).
- Connect to your VPS.
- Make a web page and start serving it over HTTPS.
# Make a web page echo 'Hello, world.' > index.html # Install Indie Web Server wget -qO- https://ind.ie/web-server/install.sh | bash # Start your secure web site web-server enable
Hit your domain in a browser. It will take a few seconds to load on the first go as your Let’s Encrypt certificates are automatically provisioned for you.
You can close your terminal and your web server will continue to run. It will be restarted automatically should it crash or when the server reboots. Your TLS certificates will be automatically renewed for you as required.
Linux and Linux-like operating systems are supported:
- Windows Subsystem for Linux
Note: the deployment server functionality requires systemd.
Copy and paste the following command into your Terminal. Before you pipe any script into your computer, always view the source code and make sure you understand what it does.
wget -qO- https://ind.ie/web-server/install.sh | bash
As a development server
You can also use Indie Web Server as a local development server with locally-trusted TLS certificates (no certificate warnings) on Linux, macOS, and Windows.
To start serving the current folder at https://localhost:
As a local proxy server
web-server proxy localhost:1313
Now you can view it at https://localhost and even your live reload will work as Indie Web Server in proxy mode also proxies WebSockets.
As a local development server with live sync of changes to your production server
web-server sync my-demo.site
Any changes in your current folder will be synced via rsync over ssh to firstname.lastname@example.org:/home/your-account/_current-folder-name. You can customise all of those details via optional flags.
As a staging server
To give others access to your server without running as a deployment server (daemon):
Then use, for example, ngrok (Pro+) to point a custom domain name to your temporary staging server. Make sure you set your
hostname file (e.g., in
/etc/hostname or via
hostnamectl set-hostname <hostname> or the equivalent for your platform) to match your domain name. The first time you hit your server via your hostname it will take a little longer to load as your Let’s Encrypt certificates are being automatically provisioned by ACME TLS.
As a production server
Once your server is running, it will survive crashes and server restarts and you can use the following commands:
web-server status: display the server status.
web-server logs: display the server logs.
web-server disable: stop the server and remove it from startup items.
You can extend the server and create your own dynamic servers using Node.js:
npm i @ind.ie/web-server
Create your own dynamic web apps in Node.js using the API.
Made with ♥ by Ind.ie.
If you like our work, fund us.