Skip to content

Manual tcp server

Setting up a TCP server manually

In this tutorial we will set up a TCP tunnel server manually.


  • A Linux server, Windows and MacOS are also supported
  • The inlets-pro binary at /usr/local/bin/

Log into your existing VM

Generate an authentication token for the tunnel:

TOKEN="$(openssl rand -base64 32)" > token.txt

# Find the instance's public IPv4 address:
PUBLIC_IP="$(curl -s"

Let's imagine the public IP resolved to which is part of the DigitalOcean range.

inlets-pro tcp server \
 --token "$TOKEN" \
 --auto-tls-san $PUBLIC_IP \
 --generate=systemd > inlets-pro.service


Description=inlets Pro TCP Server

ExecStart=/usr/local/bin/inlets-pro tcp server --auto-tls --auto-tls-san= --control-addr= --token="ISgW7E2TQk+ZmbJldN9ophfE96B93eZKk8L1+gBysg4=" --control-port=8124 --auto-tls-path=/tmp/inlets-pro


Next install the unit file with:

sudo cp inlets-pro.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable inlets-pro.service

sudo systemctl restart inlets-pro.service

You'll now be able to check the logs for the server:

sudo journalctl -u inlets-pro

Finally you can connect your TCP client from a remote network. In this case, port 5900 is being exposed for VNC, along with port 2222 for SSH. Port 2222 is an extra port added to the /etc/ssh/sshd_config file on the Linux machine to avoid conflicting with SSH on the tunnel server itself.

inlets-pro tcp client \
  --token "ISgW7E2TQk+ZmbJldN9ophfE96B93eZKk8L1+gBysg4=" \
  --upstream \
  --port 2222 \
  --port 5900 \
  --url wss://

You can now connect to the public IP of your server via SSH and VNC:

For example:

ssh -p 2222 pi@

Wrapping up

You now have a TCP tunnel server that you can connect as and when you like.

  • You can change the ports of the connected client
  • You can change the upstream
  • You can run multiple inlets-pro tcp client commands to load-balance traffic

But bear in mind that you cannot have two clients exposing different ports at the same time unless you're an inlets uplink user.

We would recommend creating TCP tunnel servers via inletsctl which automates all of the above in a few seconds.