How to host a TON Site
Hosting a TON Site requires a reverse proxy that accepts inbound ADNL connections and forwards HTTP to a local web server, plus a .ton domain record pointing to that proxy’s ADNL address.
Prerequisites
Section titled “Prerequisites”- A web server reachable by the reverse proxy (default target:
127.0.0.1on port80or443; configurable via--local host:portsor--remoteinrldp-http-proxy) - A
.tondomain registered via TON DNS rldp-http-proxyfrom a TON monorepo release, ortonutils-reverse-proxyfrom the tonutils/reverse-proxy releases
Set up the reverse proxy
Section titled “Set up the reverse proxy”A reverse proxy accepts inbound ADNL connections and forwards HTTP requests to the local web server. Two implementations are available: rldp-http-proxy (manual key generation) and tonutils-reverse-proxy (automatic key generation with QR-code domain linking). Follow the steps in How to set up a reverse proxy to configure either option.
Link the domain
Section titled “Link the domain”After configuring the reverse proxy, assign the ADNL address to the .ton domain:
- Open the domain in the dns.ton.org management interface or the TON wallet app that supports DNS record editing.
- Paste the ADNL address into the
Sitefield. - Confirm the transaction with the domain owner wallet.
The dns_adnl_address record maps the domain to the ADNL address of the reverse proxy. Resolution details are in the TON DNS reference.
Verify
Section titled “Verify”Open the .ton domain in a browser configured with a TON Proxy forward proxy. The site content served by the local web server should be visible.
Troubleshoot
Section titled “Troubleshoot”- DNS propagation delay: the
dns_adnl_addressrecord is stored on-chain. After the transaction confirms, allow a few minutes for DHT caches to refresh before testing with a browser. - Wrong ADNL address: if the site does not load, verify the ADNL address in the DNS record matches the address logged by the reverse proxy at startup. Correct it by submitting a new DNS transaction with the right value.
- Wallet signing failure: confirm the wallet holds enough TON to cover gas. If the wallet does not display a DNS record editing UI, switch to a wallet that supports TON DNS management, such as Tonkeeper or the TON web wallet.
Static sites from TON Storage
Section titled “Static sites from TON Storage”A bag containing HTML and static assets can also be served as a TON Site by combining TON Storage and a dns_storage_address DNS record. The storage gateway resolves .bag hostnames to bag content.
Related pages
Section titled “Related pages”- TON Sites: how TON Sites work
- How to set up a reverse proxy: configure
rldp-http-proxyortonutils-reverse-proxy - TON DNS: domain name registration and record types