{"id":51190,"date":"2025-09-27T22:29:47","date_gmt":"2025-09-27T19:29:47","guid":{"rendered":"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/"},"modified":"2025-09-27T22:29:48","modified_gmt":"2025-09-27T19:29:48","slug":"how-to-configure-trojan-step-by-step","status":"publish","type":"post","link":"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/","title":{"rendered":"How to Configure Trojan Step by Step"},"content":{"rendered":"<p><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#What_Trojan_is_and_what_you_need_before_starting\" >What Trojan is and what you need before starting<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#High-level_steps\" >High-level steps<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#1_Prepare_the_server\" >1) Prepare the server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#2_Point_your_domain_and_obtain_TLS_certificate\" >2) Point your domain and obtain TLS certificate<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#3_Install_the_Trojan_server\" >3) Install the Trojan server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#4_Create_a_secure_Trojan_config_server_side\" >4) Create a secure Trojan config (server side)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#5_Create_a_systemd_service_and_enable_autostart\" >5) Create a systemd service and enable autostart<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#6_Firewall_and_port_considerations\" >6) Firewall and port considerations<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#7_Configure_the_client\" >7) Configure the client<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#8_Test_the_connection_and_troubleshoot\" >8) Test the connection and troubleshoot<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#Security_and_maintenance_tips\" >Security and maintenance tips<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#Summary\" >Summary<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#FAQs\" >FAQs<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#Is_Trojan_legal_to_use\" >Is Trojan legal to use?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#Can_I_use_lets_encrypt_certificates_with_Trojan\" >Can I use let&#8217;s encrypt certificates with Trojan?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#Do_I_need_Nginx_or_can_Trojan_handle_TLS_directly\" >Do I need Nginx or can Trojan handle TLS directly?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#How_do_I_secure_the_server_beyond_the_basic_setup\" >How do I secure the server beyond the basic setup?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-trojan-step-by-step\/#Where_can_I_find_official_releases_and_documentation\" >Where can I find official releases and documentation?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"What_Trojan_is_and_what_you_need_before_starting\"><\/span>What Trojan is and what you need before starting<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>\nTrojan is <a href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-2fa-step-by-step\/\">a<\/a> lightweight, <a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-tls\" target=\"_blank\" rel=\"noopener\">tls<\/a>-based proxy protocol often used to create an encrypted tunnel between a client and a server. It intentionally looks like ordinary TLS traffic to improve privacy and reduce detection risk compared with naked proxy protocols. Before you begin, make sure you have a legal, appropriate use case and the necessary components: a <a href=\"https:\/\/www.a2hosting.com\/vps-hosting\/\" target=\"_blank\" rel=\"noopener\">vps<\/a> with a public IPv4 address, a <a href=\"https:\/\/www.a2hosting.com\/domains\/\" target=\"_blank\" rel=\"noopener\">domain name<\/a> that points to that <a href=\"https:\/\/www.a2hosting.com\/vps-hosting\/\" target=\"_blank\" rel=\"noopener\">vps<\/a>, root or <a href=\"https:\/\/www.hostinger.com\/tutorials\/sudo-and-the-sudoers-file\/\" target=\"_blank\" rel=\"noopener\">sudo<\/a> access on the server, and a valid TLS certificate (<a href=\"https:\/\/hostadvice.com\/how-to\/web-hosting\/windows\/how-to-install-lets-encrypt-in-windows-server-2022\/\" target=\"_blank\" rel=\"noopener\">let&#8217;s encrypt<\/a> is commonly used). Also decide whether you will use the original Trojan implementation or trojan-go (they share the same conceptual workflow but have different binary\/config syntaxes).\n<\/p>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"High-level_steps\"><\/span>High-level steps<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>\nConfiguring Trojan typically follows the same flow: prepare the server OS, install and configure a web server if you want to use a reverse proxy (optional but common for certificate management), obtain a TLS certificate, install the Trojan server binary, create a secure configuration file and systemd unit, open firewall ports, then configure the client with matching parameters and test the connection. The rest of this guide walks through each phase with examples and sensible defaults.\n<\/p>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"1_Prepare_the_server\"><\/span>1) Prepare the server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>\nStart with a maintained <a href=\"https:\/\/www.hostinger.com\/tutorials\/linux-commands\" target=\"_blank\" rel=\"noopener\">linux<\/a> distribution such as <a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-ubuntu\" target=\"_blank\" rel=\"noopener\">ubuntu<\/a> LTS or Debian. Keep the system updated and install common packages you will need (<a href=\"https:\/\/www.a2hosting.com\/kb\/developer-corner\/nginx-web-server\/installing-the-nginx-web-server\/\" target=\"_blank\" rel=\"noopener\">nginx<\/a>, certbot, unzip, <a href=\"https:\/\/www.hostinger.com\/tutorials\/curl-command-with-examples-linux\/\" target=\"_blank\" rel=\"noopener\">curl<\/a>). If you expect multiple services on the same <a href=\"https:\/\/www.a2hosting.com\/\" target=\"_blank\" rel=\"noopener\">host<\/a>, plan ports and virtual hosts in advance. Below is a typical sequence for Ubuntu\/Debian; adapt package manager <a href=\"https:\/\/www.hostinger.com\/tutorials\/linux-commands\" target=\"_blank\" rel=\"noopener\">commands<\/a> for other distros.\n<\/p>\n<p><\/p>\n<pre><code><a href=\"https:\/\/hostadvice.com\/how-to\/web-hosting\/ubuntu\/how-to-use-the-apt-command-to-manage-ubuntu-packages\/\" target=\"_blank\" rel=\"noopener\">sudo apt update<\/a><br \/>\nsudo apt upgrade -y<br \/>\nsudo apt install -y <a href=\"https:\/\/www.a2hosting.com\/kb\/developer-corner\/nginx-web-server\/installing-the-nginx-web-server\/\" target=\"_blank\" rel=\"noopener\">nginx<\/a> certbot python3-certbot-nginx unzip curl<br \/>\n<\/code><\/pre>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"2_Point_your_domain_and_obtain_TLS_certificate\"><\/span>2) Point your <a href=\"https:\/\/support.hostinger.com\/en\/articles\/1583424-what-are-the-differences-between-subdomain-parked-domain-and-add-on-domain\" target=\"_blank\" rel=\"noopener\">domain and<\/a> obtain TLS certificate<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>\nAdd an <a href=\"https:\/\/hostadvice.com\/blog\/domains\/what-is-an-a-record\/\" target=\"_blank\" rel=\"noopener\">a record<\/a> in your <a href=\"https:\/\/infinitydomainhosting.com\/index.php?rp=\/knowledgebase\/128\/How-to-manage-your-DNS-settings-for-your-domain.html\">DNS<\/a> <a href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-use-cpanel-or-other-control-panel\/\">control panel<\/a> pointing your chosen <a href=\"https:\/\/www.a2hosting.com\/domains\/\" target=\"_blank\" rel=\"noopener\">domain<\/a> (e.g., proxy.example.com) to the server&#8217;s IP. Wait for <a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-dns\" target=\"_blank\" rel=\"noopener\">dns<\/a> to propagate, then use Certbot to request a certificate. Using the Nginx plugin lets Certbot configure renewal hooks automatically. If you prefer a standalone method, stop nginx temporarily and use certbot &#8211;standalone.\n<\/p>\n<p><\/p>\n<pre><code>sudo certbot --nginx -d proxy.example.com<br \/>\n# or, if using standalone:<br \/>\n# sudo systemctl stop nginx<br \/>\n# sudo certbot certonly --standalone -d proxy.example.com<br \/>\n# sudo systemctl start nginx<br \/>\n<\/code><\/pre>\n<p><\/p>\n<p>\nCertbot stores certificates under \/etc\/letsencrypt\/live\/yourdomain\/; you will reference the cert and key paths in the Trojan configuration.\n<\/p>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"3_Install_the_Trojan_server\"><\/span>3) Install the Trojan server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>\nDownload the official Trojan or trojan-go release for your architecture. For Trojan-Go, grab the latest binary, unpack, move <a href=\"https:\/\/support.hostinger.com\/en\/articles\/1863967-how-to-point-a-domain-to-hostinger\" target=\"_blank\" rel=\"noopener\">it to<\/a> \/usr\/local\/bin and set executable permissions. Always verify <a href=\"https:\/\/www.a2hosting.com\/kb\/developer-corner\/linux\/working-with-file-checksums\/\" target=\"_blank\" rel=\"noopener\">checksums<\/a>\/signatures if available.\n<\/p>\n<p><\/p>\n<pre><code># Example for trojan-go (replace with desired release and arch)<br \/>\ncurl -sL  -o trojan-go.zip<br \/>\nunzip trojan-go.zip<br \/>\nsudo mv trojan-go \/usr\/local\/bin\/<br \/>\nsudo chmod +x \/usr\/local\/bin\/trojan-go<br \/>\n<\/code><\/pre>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"4_Create_a_secure_Trojan_config_server_side\"><\/span>4) Create a secure Trojan config (server side)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>\nTrojan uses a <a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-json\" target=\"_blank\" rel=\"noopener\">json<\/a> config file that contains TLS paths, password(s), and port bindings. Use a long, random password string (treat it like a credential), and set the certificate and key paths to the files issued by Certbot. Example minimal trojan-go server configuration (adjust fields to your environment):\n<\/p>\n<p><\/p>\n<pre><code>{<br \/>\n  \"run_type\": \"server\",<br \/>\n  \"local_addr\": \"0.0.0.0\",<br \/>\n  \"local_port\": 443,<br \/>\n  \"remote_addr\": \"127.0.0.1\",<br \/>\n  \"remote_port\": 80,<br \/>\n  \"password\": [\"YOUR_STRONG_PASSWORD_HERE\"],<br \/>\n  \"<a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-ssl\" target=\"_blank\" rel=\"noopener\">ssl<\/a>\": {<br \/>\n    \"cert\": \"\/etc\/letsencrypt\/live\/proxy.example.com\/fullchain.pem\",<br \/>\n    \"key\": \"\/etc\/letsencrypt\/live\/proxy.example.com\/privkey.pem\",<br \/>\n    \"<a href=\"https:\/\/www.a2hosting.com\/kb\/security\/ssl\/ssl-certificates-and-server-name-indication-sni-support\/\" target=\"_blank\" rel=\"noopener\">sni<\/a>\": \"proxy.example.com\"<br \/>\n  }<br \/>\n}<br \/>\n<\/code><\/pre>\n<p><\/p>\n<p>\nSave this file in a secure location such as \/etc\/trojan-go\/config.json and restrict permissions so only root can read it (chmod 600).\n<\/p>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"5_Create_a_systemd_service_and_enable_autostart\"><\/span>5) Create a systemd service and enable autostart<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>\nUsing systemd makes management straightforward. Create a unit file such as \/etc\/systemd\/system\/trojan-go.service that starts the binary with your config. Example unit:\n<\/p>\n<p><\/p>\n<pre><code>[Unit]<br \/>\nDescription=trojan-go service<br \/>\nAfter=network.target<br>[Service]<br \/>\nType=simple<br \/>\nUser=root<br \/>\nExecStart=\/usr\/local\/bin\/trojan-go -config \/etc\/trojan-go\/config.json<br \/>\nRestart=on-failure<br \/>\nRestartSec=5s<br>[Install]<br \/>\nWantedBy=multi-user.target<br \/>\n<\/code><\/pre>\n<p><\/p>\n<p>\nEnable and start the service:\n<\/p>\n<p><\/p>\n<pre><code>sudo systemctl daemon-reload<br \/>\nsudo systemctl enable --now trojan-go<br \/>\nsudo systemctl status trojan-go<br \/>\n<\/code><\/pre>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"6_Firewall_and_port_considerations\"><\/span>6) Firewall and port considerations<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>\nOpen the port you configured (typically 443) and optionally limit <a href=\"https:\/\/www.a2hosting.com\/kb\/getting-started-guide\/accessing-your-account\/using-ssh-secure-shell\/\" target=\"_blank\" rel=\"noopener\">ssh<\/a> to a different port or specific IPs. If using <a href=\"https:\/\/hostadvice.com\/how-to\/web-hosting\/ubuntu\/how-to-configure-firewall-with-ufw-on-ubuntu-18\/\" target=\"_blank\" rel=\"noopener\">ufw<\/a>:\n<\/p>\n<p><\/p>\n<pre><code>sudo ufw allow 443\/<a href=\"https:\/\/www.hostinger.com\/tutorials\/tcp-protocol\" target=\"_blank\" rel=\"noopener\">tcp<\/a><br \/>\nsudo ufw allow <a href=\"https:\/\/hostadvice.com\/how-to\/web-hosting\/windows\/how-to-install-an-openssh-server-client-on-a-windows-2016-server\/\" target=\"_blank\" rel=\"noopener\">openssh<\/a><br \/>\nsudo ufw enable<br \/>\n<\/code><\/pre>\n<p><\/p>\n<p>\nConfirm the service binds to the expected interface and port with ss or netstat. If you run other services on 443 (for example, a web server), you can reverse-proxy through Nginx to the trojan backend or use SNI routing approaches; Nginx can serve an innocuous site and proxy the TLS stream to trojan if configured carefully.\n<\/p>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"7_Configure_the_client\"><\/span>7) Configure the client<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>\nClients need a matching password, the server <a href=\"https:\/\/www.a2hosting.com\/domains\/\" target=\"_blank\" rel=\"noopener\">domain<\/a> or IP, and the TLS settings. Many GUI clients exist (trojan-qt5, v2rayN with a Trojan plugin, or trojan-go client). A typical JSON for a trojan client:\n<\/p>\n<p><\/p>\n<pre><code>{<br \/>\n  \"run_type\": \"client\",<br \/>\n  \"local_addr\": \"127.0.0.1\",<br \/>\n  \"local_port\": 1080,<br \/>\n  \"remote_addr\": \"proxy.example.com\",<br \/>\n  \"remote_port\": 443,<br \/>\n  \"password\": [\"YOUR_STRONG_PASSWORD_HERE\"],<br \/>\n  \"ssl\": {<br \/>\n    \"sni\": \"proxy.example.com\"<br \/>\n  }<br \/>\n}<br \/>\n<\/code><\/pre>\n<p><\/p>\n<p>\nAfter starting the client, point your applications to 127.0.0.1:1080 (SOCKS5) or configure system-level proxying through a tool like proxychains, redsocks, or your OS proxy settings. Some GUI clients offer a system proxy auto-setup.\n<\/p>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"8_Test_the_connection_and_troubleshoot\"><\/span>8) Test the connection and troubleshoot<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>\nBasic tests include verifying the client can establish a TLS handshake and browse to a simple site. On the client, check logs for connection success messages. On the server, use journalctl -u trojan-go -f to view runtime logs. Common issues and quick checks:\n<\/p>\n<p><!--KB_CAT_BLOCK--><\/p>\n<figure class=\"kb-cat-placeholder\" style=\"margin:1.75rem 0;display:block;\">\n<div class=\"kb-cat-wrap\" style=\"position:relative; overflow:hidden; border-radius:12px; box-shadow:0 10px 36px rgba(0,0,0,0.14);\"><img src=\"https:\/\/infinitydomainhosting.com\/kb\/assets\/img\/cat-default.webp\" alt=\"How to Configure Trojan Step by Step\" loading=\"lazy\" decoding=\"async\" style=\"max-width:100%;height:auto;display:block;border-radius:12px;box-shadow:0 8px 28px rgba(0,0,0,0.12);\" \/><\/p>\n<div class=\"kb-cat-gradient\" style=\"position:absolute; inset:0; background:linear-gradient(180deg, rgba(9,23,60,0.66) 0%, rgba(11,30,70,0.45) 40%, rgba(11,30,70,0.15) 100%);\"><\/div>\n<div class=\"kb-cat-textbox\" style=\"position:absolute; inset:auto 5% 7% 5%; color:#fff; text-align:center; display:flex; flex-direction:column; gap:.4rem; align-items:center; justify-content:flex-end;\">\n<div class=\"kb-cat-title\" style=\"font-weight:800; font-size:clamp(20px,3.6vw,34px); line-height:1.2; letter-spacing:.2px; text-shadow:0 1px 2px rgba(0,0,0,.35);\">How to Configure Trojan Step by Step<\/div>\n<div class=\"kb-cat-meta\" style=\"opacity:1; font-weight:600; font-size:clamp(13px,2.6vw,16px); line-height:1.45; text-shadow:0 1px 2px rgba(0,0,0,.28);\">What Trojan is and what you need before starting Trojan is a lightweight, tls-based proxy protocol often used to create an encrypted tunnel between a client and a server. It\u2026<\/div>\n<div class=\"kb-cat-desc\" style=\"opacity:1; font-weight:500; font-size:clamp(12px,2.4vw,15px); line-height:1.5; max-width:900px; text-wrap:balance; text-shadow:0 1px 2px rgba(0,0,0,.25);\">AI<\/div>\n<\/div>\n<\/div>\n<\/figure>\n<p><\/p>\n<ul><\/p>\n<li>Certificate errors: confirm cert paths in the server config and that the cert covers <a href=\"https:\/\/support.hostinger.com\/en\/articles\/6807580-website-builder-how-to-change-a-domain\" target=\"_blank\" rel=\"noopener\">the domain<\/a> used by the client.<\/li>\n<p><\/p>\n<li>Port closed: verify firewall rules and that the service is listening on the expected port (ss -tlnp).<\/li>\n<p><\/p>\n<li>Password mismatch: ensure both client and server have identical password strings.<\/li>\n<p><\/p>\n<li>DNS problems: ensure the client resolves proxy.example.com to the server IP (use <a href=\"https:\/\/hostadvice.com\/blog\/domains\/what-is-nslookup\/\" target=\"_blank\" rel=\"noopener\">nslookup<\/a>\/dig).<\/li>\n<p><\/p>\n<li>Conflicts with Nginx: if both Nginx and trojan use 443, either use different ports, configure Nginx to proxy TLS to trojan, or let trojan handle TLS and proxy HTTP\/S through another virtual <a href=\"https:\/\/www.a2hosting.com\/\" target=\"_blank\" rel=\"noopener\">host<\/a>.<\/li>\n<p>\n<\/ul>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Security_and_maintenance_tips\"><\/span>Security and maintenance tips<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>\nTreat Trojan credentials and certificate private keys carefully , set strict file permissions and rotate passwords periodically. Keep the server OS and the trojan binary up to date, and monitor logs for suspicious activity. Enable automatic certificate renewals via Certbot (certbot renew runs from a system <a href=\"https:\/\/www.hostinger.com\/tutorials\/cron-job\" target=\"_blank\" rel=\"noopener\">cron<\/a> or systemd timer) and ensure any renewal hooks that reload the trojan service are in place if you rely on new certificates.\n<\/p>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>\nSetting up Trojan involves preparing a VPS and domain, obtaining a valid TLS certificate, installing the chosen Trojan binary, writing a secure JSON configuration on both server and client sides, enabling the service under systemd, and opening the required ports. Careful attention to certificate paths, matching credentials, and firewall configuration will prevent most common issues. Always use the setup responsibly and in compliance with local laws and acceptable use policies.\n<\/p>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"FAQs\"><\/span>FAQs<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Is_Trojan_legal_to_use\"><\/span>Is Trojan legal to use?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>\nLegality depends on your jurisdiction and how you use it. Trojan is a privacy\/proxy tool; using it for legitimate privacy, testing, or secure access is typically legal, but bypassing laws, sanctions, or committing illicit activities is not. Check local regulations and <a href=\"https:\/\/infinitydomainhosting.com\/terms-of-service.php\">terms of service<\/a> for networks you connect to.\n<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_use_lets_encrypt_certificates_with_Trojan\"><\/span>Can I use <a href=\"https:\/\/hostadvice.com\/how-to\/web-hosting\/windows\/how-to-install-lets-encrypt-in-windows-server-2022\/\" target=\"_blank\" rel=\"noopener\">let&#8217;s encrypt<\/a> certificates with Trojan?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>\nYes. Certbot-issued certificates (stored in \/etc\/letsencrypt\/live\/yourdomain\/) are commonly used. Point the &#8220;cert&#8221; and &#8220;key&#8221; fields in the Trojan config to the fullchain.pem and privkey.pem files respectively. Ensure renewals are handled and the service reloads when certificates change.\n<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Do_I_need_Nginx_or_can_Trojan_handle_TLS_directly\"><\/span>Do I need Nginx or can Trojan handle TLS directly?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>\nTrojan can handle TLS directly without Nginx. Nginx is useful if you want to host regular websites, have complex virtual <a href=\"https:\/\/hostadvice.com\/\" target=\"_blank\" rel=\"noopener\">hosting<\/a> requirements, or prefer Certbot\u2019s nginx plugin for certificate issuance with fewer steps. If both run on port 443, you must coordinate ports, use SNI-based routing, or proxy traffic appropriately.\n<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_do_I_secure_the_server_beyond_the_basic_setup\"><\/span>How do I secure the server beyond the basic setup?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>\nUse strong, unique passwords, restrict file permissions for config and keys, enable automatic updates where feasible, limit <a href=\"https:\/\/www.a2hosting.com\/kb\/getting-started-guide\/accessing-your-account\/using-ssh-secure-shell\/\" target=\"_blank\" rel=\"noopener\">ssh<\/a> access, employ intrusion detection or log monitoring, and consider <a href=\"https:\/\/www.a2hosting.com\/kb\/security\/hardening-a-server-with-fail2ban\/\" target=\"_blank\" rel=\"noopener\">fail2ban<\/a> to reduce brute-force risk. Regularly review logs and update the trojan binary when releases address security issues.\n<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Where_can_I_find_official_releases_and_documentation\"><\/span>Where can I find official releases and documentation?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>\nRefer to the project\u2019s official GitHub repository and release pages for downloads and documentation (look for trojan, trojan-go, or the client projects). Always download binaries from trusted sources and verify release signatures or checksums when provided.\n<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What Trojan is and what you need before starting Trojan is a lightweight, tls-based proxy protocol often used to create an encrypted&hellip;<\/p>\n","protected":false},"author":1,"featured_media":51191,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[8,9405,86,4593,9,1,4591,4594,3,5,10,4,11,88,2],"tags":[811,515,670,706,11788,719,525,11724,406],"class_list":["post-51190","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-website-security","category-ai","category-computer-security","category-databases","category-domains","category-general","category-ip-address","category-networking","category-php-scripts","category-seo","category-servers","category-ssl-certificates","category-support","category-web-hosting","category-wordpress","tag-configuration","tag-configure","tag-guide","tag-how-to","tag-how-to-configure-trojan-step-by-step","tag-setup","tag-step-by-step","tag-trojan","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/posts\/51190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/comments?post=51190"}],"version-history":[{"count":1,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/posts\/51190\/revisions"}],"predecessor-version":[{"id":51192,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/posts\/51190\/revisions\/51192"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/media\/51191"}],"wp:attachment":[{"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/media?parent=51190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/categories?post=51190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/tags?post=51190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}