Complete guide to deploying your own decentralized website on TON
TON Sites are decentralized websites hosted on the TON Network. Unlike traditional websites that use IP addresses and TCP/IP, TON Sites use:
Architecture
Censorship-resistant hosting, no domain seizure risk, payments in TON, and true ownership of your web presence.
.ton domain at dns.ton.org*.adnl)Make sure your firewall allows UDP traffic. On Ubuntu: sudo ufw allow 3333/udp
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.
If you already have a domain and ran the proxy without --domain flag:
Changes may take a few minutes to propagate across the TON network.
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
}
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
Run the proxy multiple times with different --domain flags, or configure your web server to handle multiple virtual hosts.
The proxy adds these headers to requests:
X-Adnl-Ip - Client's IP addressX-Adnl-Id - Client's ADNL ID