Host a site
You need a machine with a public IP address, with port 6767 open and the CLI installed on it.
1. Create a certificate
Section titled “1. Create a certificate”sonion cert --host <your-ip> --out ./certsThis writes certs/cert.pem and certs/key.pem, and prints the certificate’s fingerprint.
2. Start the server
Section titled “2. Start the server”sonion serve --root ./my-site --cert certs/cert.pem --key certs/key.pemYour folder needs an index.html. Keep this running with systemd, tmux etc.
3. Create an account
Section titled “3. Create an account”sonion register --username you --password "something long"sonion login --username you --password "something long"login prints an API key. Use it in the next step.
4. Register your domain
Section titled “4. Register your domain”sonion put-domain yourname.son --api-key <key> --endpoints <your-ip>:6767 --cert certs/cert.pemThe --cert flag matters. It publishes your certificate’s fingerprint in the domain record, so browsers can trust your self-signed certificate. Without it, your site won’t open.
5. Open it
Section titled “5. Open it”Go to sonion://yourname.son in the browser.
Link to other sites
Section titled “Link to other sites”Use a full sonion:// address:
<a href="sonion://other.son/">Another site</a>Links and GET forms work this way. On Windows, images, scripts and fetch calls can’t load from a sonion:// address, so keep those files on your own site and use relative paths.
How files are served
Section titled “How files are served”/about/servesabout/index.html, and/aboutredirects to/about/if that folder exists.- A missing path without a file extension serves your root
index.html, so single-page apps work. - A missing path with an extension returns a
404. Add404.htmlto your folder to customise it. - Files are limited to 10 MB.
- Static sites accept
GET,HEADandOPTIONS. For anything else, run a backend.
You can also register and manage domains on the domains.son using its own API instead of the CLI.