How to host a TON Site
Complete guide to deploying your own decentralized website on TON
1 Overview
TON Sites are decentralized websites hosted on the TON Network. Unlike traditional websites that use IP addresses and TCP/IP, TON Sites use:
- ADNL Address - A unique cryptographic identifier (instead of IP address)
- RLDP Protocol - Reliable Large Datagram Protocol over UDP
- Built-in Encryption - ADNL handles encryption, so HTTPS is not needed
Architecture
Censorship-resistant hosting, no domain seizure risk, payments in TON, and true ownership of your web presence.
2 Prerequisites
Server requirements
- Public IP Address - Your server must have a white/public IP
- UDP Port Open - Inbound and outbound UDP traffic on port 3333 (configurable)
- Web Server - Apache, Nginx, or any HTTP server running on localhost
- Linux Recommended - Ubuntu 20.04+ or Debian 11+
Optional: TON domain
- Purchase a
.tondomain at dns.ton.org - Domains are NFTs - you fully own them
- Without a domain, your site is accessible via raw ADNL address (
*.adnl)
Make sure your firewall allows UDP traffic. On Ubuntu: sudo ufw allow 3333/udp
3 Quick start
The easiest way to host a TON Site is using tonutils-reverse-proxy.
# Download for Linux (AMD64)
wget https://github.com/tonutils/reverse-proxy/releases/latest/download/tonutils-reverse-proxy-linux-amd64
chmod +x tonutils-reverse-proxy-linux-amd64
For ARM64, Mac, or Windows, visit the releases page.
Make sure your website is running on http://127.0.0.1:80. For testing:
# Quick test with Python
echo "Hello TON!" > index.html
python3 -m http.server 80
Option A: With .ton domain
./tonutils-reverse-proxy-linux-amd64 --domain your-domain.ton
Scan the QR code with Tonkeeper/Tonhub and confirm the transaction to link your domain.
Option B: Without domain (ADNL only)
./tonutils-reverse-proxy-linux-amd64
Your site will be accessible via *.adnl address shown in the terminal. Example: u7erdj5q...egcrtz.adnl.website
Access your site through a TON gateway:
https://your-domain.ton.run
Your TON Site is now live! Keep the proxy running to serve requests.
4 Domain setup
Buying a .ton domain
- Visit dns.ton.org
- Search for your desired domain name (minimum 4 characters)
- Connect your wallet (Tonkeeper, Tonhub, etc.)
- Place a bid or buy directly (domains are NFTs sold via auction)
- Once purchased, the domain NFT appears in your wallet
Linking domain to your site
If you already have a domain and ran the proxy without --domain flag:
- Go to dns.ton.org
- Click on your domain
- Edit the "Site" record
- Paste your ADNL address (from proxy output)
- Confirm the transaction
Changes may take a few minutes to propagate across the TON network.
5 Advanced configuration
Configuration file
After first run, a config.json file is created. You can customize:
{
"proxy_pass": "http://127.0.0.1:80/", // Your web server
"network_config_url": "...", // Liteserver config
"external_ip": "auto", // Or your public IP
"port": 3333 // UDP port
}
Running as a service (systemd)
Create /etc/systemd/system/ton-proxy.service:
[Unit]
Description=TON Site Reverse Proxy
After=network.target
[Service]
Type=simple
User=www-data
WorkingDirectory=/opt/ton-proxy
ExecStart=/opt/ton-proxy/tonutils-reverse-proxy-linux-amd64
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
sudo systemctl enable ton-proxy
sudo systemctl start ton-proxy
Multiple domains
Run the proxy multiple times with different --domain flags, or configure your web server to handle multiple virtual hosts.
Custom headers
The proxy adds these headers to requests:
X-Adnl-Ip- Client's IP addressX-Adnl-Id- Client's ADNL ID