TUIC Installation Guide#
One-Click Script#
wget https://raw.githubusercontent.com/imbalaomao/tuic-install/main/tuic.sh && bash tuic.sh
Item | |
---|---|
Program | /opt/tuic/server |
Configuration | /opt/tuic/server_config.json |
View Logs | journalctl -u tuic --output cat -e |
Real-time Logs | journalctl -u tuic --output cat -f |
Update#
systemctl stop tuic && wget -O /opt/tuic/tuic_server https://github.com/EAimTY/tuic/releases/download/tuic-server-1.0.0/tuic-server-1.0.0-x86_64-unknown-linux-musl && chmod +x /opt/tuic/tuic_server && systemctl restart tuic && sleep 0.2 && systemctl status tuic
Uninstall#
systemctl disable tuic && rm -rf /etc/systemd/system/tuic.service
rm -rf /opt/tuic
~/.acme.sh/acme.sh --remove -d example.com(replace with your domain)
Step-by-Step Installation#
- Download the latest version of TUIC core
To ensure compatibility, download the musl version of the core
mkdir /opt/tuic && cd /opt/tuic
wget -O server https://github.com/EAimTY/tuic/releases/download/tuic-server-1.0.0-rc0/tuic-server-1.0.0-rc0-x86_64-unknown-linux-musl && chmod +x server
- Create the configuration file
- Create
server.json
and enter the following content:
{
"server": "[::]:8443",
"users": {
"Enter a UUID here": "Set a password"
},
"certificate": "Domain certificate file, if not available, please use acme.sh",
"private_key": "Domain private key file, if not available, please use acme.sh",
"congestion_control": "bbr",
"alpn": [
"spdy/3.1"
],
"max_external_packet_size": 1500,
"log_level": "debug",
"gc_interval": "3s",
"max_idle_time": "30s"
}
- Create the service
- Create
/etc/systemd/system/tuic.service
and enter the following content:
[Unit]
After=network.target nss-lookup.target
[Service]
User=root
WorkingDirectory=/opt/tuic
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW
ExecStart=/opt/tuic/server -c /opt/tuic/server.json
Restart=on-failure
RestartSec=10
LimitNOFILE=infinity
[Install]
WantedBy=multi-user.target
- Start the program
systemctl enable --now tuic && sleep 0.2 && systemctl status tuic
Client Configuration#
Using Nekoray as an example
Select Manual Input Configuration - Custom (Other Core), and enter the following content in the largest blank space below:
{
"relay": {
"server": "Server Domain:8443",
"uuid": "Your UUID",
"password": "Password",
"ip": "Server IP",
"udp_relay_mode": "quic",
"congestion_control": "bbr",
"alpn": ["spdy/3.1"],
"gc_lifetime": "15s",
"gc_interval": "3s"
},
"local": {
"server": "127.0.0.1:1080"
},
"log_level": "debug"
}
Then enter the domain in the Address field, enter 8443
in the Port field, enter 1080
in the Socks Port field, select the added TUIC core in Core, enter -c %config%
in the Command field, select json
as the Configuration File Extension, and save.