Home

Hosting Guide

How to Host a TON Site

Complete guide to deploying your own decentralized website on TON

Table of Contents

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:

Architecture

User Browser -> TON Gateway -> TON Network (ADNL) -> Your Proxy -> Web Server
Why TON Sites?

Censorship-resistant hosting, no domain seizure risk, payments in TON, and true ownership of your web presence.

2 Prerequisites

Server Requirements

Optional: TON Domain

Firewall Check

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.

1 Download the 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.

2 Start Your Web Server

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
3 Run the Proxy

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

4 Verify Your Site

Access your site through a TON gateway:

https://your-domain.ton.run
Success!

Your TON Site is now live! Keep the proxy running to serve requests.

4 Domain Setup

Buying a .ton Domain

  1. Visit dns.ton.org
  2. Search for your desired domain name (minimum 4 characters)
  3. Connect your wallet (Tonkeeper, Tonhub, etc.)
  4. Place a bid or buy directly (domains are NFTs sold via auction)
  5. 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:

  1. Go to dns.ton.org
  2. Click on your domain
  3. Edit the "Site" record
  4. Paste your ADNL address (from proxy output)
  5. Confirm the transaction
DNS Propagation

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:

6 FAQ

How much does it cost to host a TON Site?
The proxy software is free. You only need to pay for your server (VPS from $5/month) and optionally a .ton domain (varies by auction, typically 1-5 TON for common names).
Can I use Cloudflare or other CDN?
TON Sites use ADNL/RLDP over UDP, not HTTP/TCP. Traditional CDNs won't work directly. However, gateways like ton.run already provide edge caching.
My site shows "contract is not initialized"
This means the .ton domain exists but has no site record configured. Go to dns.ton.org, select your domain, and set the "Site" record to your ADNL address.
My site shows "failed to find address in DHT"
Your proxy server is offline or unreachable. Check that: (1) the proxy is running, (2) your server has a public IP, (3) UDP port 3333 is open in firewall.
Can I host dynamic websites (PHP, Node.js)?
Yes! The proxy forwards HTTP requests to your local web server. You can run any backend (PHP, Node.js, Python, etc.) on localhost:80.
How do I update my site content?
Just update your web server files like any normal website. The proxy forwards requests to your web server in real-time. No blockchain transaction needed for content updates.

7 Resources