Halaman ini belum tersedia dalam bahasa Bahasa Melayu. Ia dipaparkan dalam bahasa Inggeris.
Install Localtonet on Linux
Dalam halaman ini 9 bahagian
- Before you start
- Install with the script
- Run the install script
- Check the install
- Install manually
- Download and extract
- Optional: move it into your PATH
- Start the client
- Start it with your token
- Check the session
- Run as a systemd service
- Install the service
- Check that it runs
- Service commands
- The unit and its logs
- Upgrade
- Replace the client
- Restart the service
- Uninstall
- Troubleshooting
- 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.
curlorwget, andunzip.- 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 #
-
Run the install script #
Terminalcurl -fsSL https://localtonet.com/install.sh | shThe 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 thatsudo localtonetworks on distributions wheresudodoes not search/usr/local/bin.The script uses
sudowhen your user cannot write to the install folder, which is why it may ask for your password. Ifunzipis missing, it tries to install it with the package manager of your distribution. -
Check the install #
The script ends by printing the installed version. You can print it again at any time:
Terminallocaltonet --version
Install manually #
If you prefer a direct download, take the archive for your system. Each ZIP contains one file, localtonet.
| CPU | glibc (Debian, Ubuntu, Fedora, RHEL and most others) | musl (Alpine) |
|---|---|---|
| x64 | localtonet-linux-x64.zip | localtonet-linux-musl-x64.zip |
| ARM64 | localtonet-linux-arm64.zip | localtonet-linux-musl-arm64.zip |
| ARM (32-bit) | localtonet-linux-arm.zip | localtonet-linux-musl-arm.zip |
uname -m prints your CPU type: x86_64 is x64, aarch64 is ARM64 and armv7l is ARM.
-
Download and extract #
The example uses the x64 glibc build. Replace the file name with the archive for your system.
Terminalwget https://localtonet.com/download/localtonet-linux-x64.zip unzip localtonet-linux-x64.zip -d ~/localtonet chmod 755 ~/localtonet/localtonet -
Optional: move it into your PATH #
Without this step you start the client by its path,
~/localtonet/localtonet. After it you can typelocaltonetin any folder.Terminalsudo mv ~/localtonet/localtonet /usr/local/bin/localtonet
Start the client #
-
Start it with your token #
Terminallocaltonet --authtoken <YOUR_TOKEN>The client stores the token locally for your user. The next time you can start it with
localtonetalone. If you start it without a stored token it asksPlease Enter AuthToken or PIN. -
Check the session #
The terminal shows
Session Status: Connectedabove a table with one row per running tunnel:IP/Url,Protocol,Client IP,Client Port,PingandStatus. 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.
-
Install the service #
Terminalsudo 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--authtokento find it. -
Check that it runs #
Terminalsudo 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>.
| Command | What it does |
|---|---|
--install-service | Writes the unit file, enables the unit and starts it. |
--start-service | Starts the unit, for example after you stopped it. |
--stop-service | Stops the unit. It stays enabled and starts again after a reboot. |
--status-service | Prints the state, for example Running, Stopped or Error when the unit has failed. |
--remove-service | Stops 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:
systemctl list-units 'Localtonet_*'
systemctl status Localtonet_<TOKEN_PREFIX>
journalctl -u Localtonet_<TOKEN_PREFIX> -fThe 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 #
-
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
localtonetfile.Terminalcurl -fsSL https://localtonet.com/install.sh | sh -
Restart the service #
A running service keeps using the old version until it restarts.
Terminalsudo 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 #
- If you installed the service, remove it:
sudo localtonet --remove-service --authtoken <YOUR_TOKEN> - To remove the stored token, start the client and press F12.
- Delete the client:
sudo rm /usr/local/bin/localtonet /usr/bin/localtonetafter 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.