رفتن به محتوا
Localtonet Localtonet داشبورد

این صفحه هنوز به فارسی در دسترس نیست و به زبان انگلیسی نمایش داده می‌شود.

Install Localtonet on Linux

کمک درباره این صفحه
در این صفحه 9 بخش
  1. Before you start
  2. Install with the script
  3. Run the install script
  4. Check the install
  5. Install manually
  6. Download and extract
  7. Optional: move it into your PATH
  8. Start the client
  9. Start it with your token
  10. Check the session
  11. Run as a systemd service
  12. Install the service
  13. Check that it runs
  14. Service commands
  15. The unit and its logs
  16. Upgrade
  17. Replace the client
  18. Restart the service
  19. Uninstall
  20. Troubleshooting
  21. Related pages

On Linux the Localtonet client is a single console program. Install it with the install script or from a ZIP archive, start it with your AuthToken, and install it as a systemd service if it should start after every reboot.

Before you start #

  • A Localtonet account. Create one for free if you do not have one.
  • Your AuthToken. Select Copy on the AuthToken card of the Dashboard, or copy a token from My Tokens.
  • curl or wget, and unzip.
  • For the systemd service: root access and a distribution that uses systemd.

Other ways to run Localtonet on Linux. On Debian, Ubuntu, Fedora and RHEL you can install a DEB or RPM package that brings its own services. There are separate guides for Docker, OpenWrt routers and Termux on Android.

Install with the script #

  1. Run the install script #

    Terminal
    curl -fsSL https://localtonet.com/install.sh | sh

    The script detects your CPU (x64, ARM64 or ARM) and whether the system uses glibc or musl, downloads the matching build and installs it to /usr/local/bin/localtonet. It also creates the link /usr/bin/localtonet, so that sudo localtonet works on distributions where sudo does not search /usr/local/bin.

    The script uses sudo when your user cannot write to the install folder, which is why it may ask for your password. If unzip is missing, it tries to install it with the package manager of your distribution.

  2. Check the install #

    The script ends by printing the installed version. You can print it again at any time:

    Terminal
    localtonet --version

Install manually #

If you prefer a direct download, take the archive for your system. Each ZIP contains one file, localtonet.

uname -m prints your CPU type: x86_64 is x64, aarch64 is ARM64 and armv7l is ARM.

  1. Download and extract #

    The example uses the x64 glibc build. Replace the file name with the archive for your system.

    Terminal
    wget https://localtonet.com/download/localtonet-linux-x64.zip
    unzip localtonet-linux-x64.zip -d ~/localtonet
    chmod 755 ~/localtonet/localtonet
  2. Optional: move it into your PATH #

    Without this step you start the client by its path, ~/localtonet/localtonet. After it you can type localtonet in any folder.

    Terminal
    sudo mv ~/localtonet/localtonet /usr/local/bin/localtonet

Start the client #

  1. Start it with your token #

    Terminal
    localtonet --authtoken <YOUR_TOKEN>

    The client stores the token locally for your user. The next time you can start it with localtonet alone. If you start it without a stored token it asks Please Enter AuthToken or PIN.

  2. Check the session #

    The terminal shows Session Status: Connected above a table with one row per running tunnel: IP/Url, Protocol, Client IP, Client Port, Ping and Status. The table is empty until you start a tunnel in the dashboard, see Quick start.

    Press Ctrl + C to stop the client. Press F12 to remove the stored token and exit.

When the output is not a terminal, for example when you redirect it to a file, the client writes one plain line per change instead of the table.

VPN needs root. If the device is part of a VPN Manager network and the client runs without root, the VPN row of the table shows Admin rights required. Start the client with sudo or as a service in that case.

Run as a systemd service #

A service starts Localtonet after every reboot, keeps it running after you log out and does not need an open terminal. The service commands need root.

  1. Install the service #

    Terminal
    sudo localtonet --install-service --authtoken <YOUR_TOKEN>

    The command writes a systemd unit for this token, enables it and starts it right away. It answers with the name of the unit:

    [CLI] Installed service 'Localtonet_<TOKEN_PREFIX>'

    <TOKEN_PREFIX> is the first 9 characters of your token. Every token gets its own unit, so the other service commands need the same --authtoken to find it.

  2. Check that it runs #

    Terminal
    sudo localtonet --status-service --authtoken <YOUR_TOKEN>

    A running service answers [CLI] Service 'Localtonet_<TOKEN_PREFIX>' status: Running. In the dashboard, the token shows Online under My Tokens.

Service commands #

Run each command with sudo and add --authtoken <YOUR_TOKEN>.

CommandWhat it does
--install-serviceWrites the unit file, enables the unit and starts it.
--start-serviceStarts the unit, for example after you stopped it.
--stop-serviceStops the unit. It stays enabled and starts again after a reboot.
--status-servicePrints the state, for example Running, Stopped or Error when the unit has failed.
--remove-serviceStops and disables the unit and deletes the unit file.

The service is installed with the options you pass together with --install-service. The options are listed in the CLI reference.

The unit and its logs #

The unit file is /etc/systemd/system/Localtonet_<TOKEN_PREFIX>.service. systemd restarts the client five seconds after a failure. Because it is a normal systemd unit, you can also manage it with systemctl and read its output with journalctl:

Terminal
systemctl list-units 'Localtonet_*'
systemctl status Localtonet_<TOKEN_PREFIX>
journalctl -u Localtonet_<TOKEN_PREFIX> -f

The unit starts the localtonet file from the path it had when you installed the service. One exception: if that path is below /root/, the install command copies the file to /usr/local/lib/Localtonet_<TOKEN_PREFIX>/ and the service runs the copy.

Upgrade #

  1. Replace the client #

    Run the install script again. It is safe to re-run and overwrites the installed client with the current version. After a manual install, download the current archive and replace the localtonet file.

    Terminal
    curl -fsSL https://localtonet.com/install.sh | sh
  2. Restart the service #

    A running service keeps using the old version until it restarts.

    Terminal
    sudo systemctl restart Localtonet_<TOKEN_PREFIX>

    If the service runs a copy below /usr/local/lib/, remove the service and install it again with the new client instead.

Under My Tokens, the Client column shows the version the device last reported and a Need Update badge when a newer one is available.

Uninstall #

  1. If you installed the service, remove it: sudo localtonet --remove-service --authtoken <YOUR_TOKEN>
  2. To remove the stored token, start the client and press F12.
  3. Delete the client: sudo rm /usr/local/bin/localtonet /usr/bin/localtonet after the script install, or the folder you extracted the archive to.

Troubleshooting #

Install script: Unsupported architecture

The script has builds for x64 (x86_64), ARM64 (aarch64) and 32-bit ARM (armv7l). Other CPU types are not supported by the Linux builds.

Install script: Neither curl nor wget found

Install curl or wget with your package manager and run the script again.

Install script: Failed to install 'unzip'

The script could not install unzip by itself. Install it with your package manager and run the script again.

Installed but not found in PATH

Open a new shell, or start the client by its full path, /usr/local/bin/localtonet.

sudo: localtonet: command not found

After a manual install the client is not in the search path of sudo. Use the full path, for example sudo ~/localtonet/localtonet --install-service --authtoken <YOUR_TOKEN>, or move the file to /usr/local/bin first.

Install failed: 'Linux systemd service installation' requires elevated (admin/root) privileges.

The command ran without root. Repeat it with sudo. The same applies to --start-service, --stop-service and --remove-service.

Install failed: Systemd unit already exists for 'Localtonet_…'

A service for this token is already installed. Check it with --status-service. To install it again, run --remove-service first.

The service commands fail on a system without systemd

Service mode uses systemd. On systems without it, start the client another way, for example in a Docker container. The console client has a headless mode for this: --headless runs without prompts and reads the token from a file given with --authtoken-file. See the CLI reference.

Wrong Token!

The client expects the 33-character AuthToken from My Tokens, or a 6-digit PIN that has not expired. Copy the token again and enter it at the prompt.

This token is used in another localtonet application!

Another Localtonet client on this machine already runs with the same token. Close it, or start this one with a different token. Use one running client per token.

پشتیبانی