Skip to main content
50% off all plans, limited time. Starting at $2.48/mo
Static Web Server

Static Web Server

Static Web Server is a small asynchronous web server for static files, written in Rust. It serves a directory over HTTP/2 with compression, cache headers, and TLS, from a binary a few megabytes wide. Apache-2.0 licensed with 2,300+ GitHub stars.

At a glance

2.3k

GitHub stars

1

Page views

License Apache-2.0 Version v2.43.0 OS Ubuntu Server 24.04 LTS Min RAM 1 GB IP IPV4,IPV6

Access

  • Open your browser: https://<SERVER-IP>
  • Static Web Server uses HTTPS on port 443.
  • The TLS certificate is self-signed, so the browser will show a warning on the first visit.

Publish Website Files

Place your static website files in: /var/www/html

Example:

cp -r mysite/* /var/www/html/
chmod -R a+rX /var/www/html

Changes are served immediately. No restart is required after updating files.

Important Files & Directories

  • Binary: /usr/local/bin/static-web-server
  • Web Root: /var/www/html
  • Environment File: /etc/default/static-web-server
  • TLS Certificate: /etc/static-web-server/cert.pem
  • TLS Private Key: /etc/static-web-server/key.pem
  • Socket Unit: /etc/systemd/system/static-web-server.socket
  • Service Unit: /etc/systemd/system/static-web-server.service

Service Management

Check socket status:

systemctl status static-web-server.socket

Check service status:

systemctl status static-web-server.service

Restart Static Web Server:

systemctl restart static-web-server.service

View logs:

journalctl -u static-web-server.service -f

Enable socket activation:

systemctl enable static-web-server.socket

Configuration

Environment configuration:

/etc/default/static-web-server

After changing configuration or TLS certificates:

systemctl restart static-web-server.service

Notes

  • Static Web Server runs using systemd socket activation.
  • Systemd owns port 443 and passes connections to SWS.
  • Website files are served publicly without authentication.

Deploy Static Web Server now. From $2.48/mo.