Przejdź do treści
Localtonet Localtonet Panel

Ta strona nie jest jeszcze dostępna w języku: Polski. Wyświetlamy ją po angielsku.

Install Localtonet on macOS

Pomoc z tą stroną
Na tej stronie 9 sekcji
  1. Before you start
  2. Install with Homebrew
  3. Add the Localtonet tap and install
  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 launchd service
  12. Install the service
  13. Check that it runs
  14. What the install creates
  15. Service commands
  16. Upgrade
  17. Uninstall
  18. Troubleshooting
  19. Related pages

On macOS the Localtonet client is a console program for Intel and Apple Silicon Macs. Install it with Homebrew or from a ZIP archive, start it with your AuthToken, and install it as a launchd service if it should start on every boot.

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.
  • For the Homebrew install: Homebrew.
  • For the launchd service: an account that can use sudo.

Install with Homebrew #

  1. Add the Localtonet tap and install #

    A tap adds a third-party repository to Homebrew, so that you can install and update formulae from it.

    Terminal
    brew tap localtonet/tap
    brew install localtonet
  2. Check the install #

    Terminal
    localtonet --version

    The command prints the version of the client.

Install manually #

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

MacArchive
Apple Silicon (ARM64)localtonet-osx-arm64.zip
Intel (x64)localtonet-osx-64.zip
  1. Download and extract #

    Apple Silicon
    curl -L https://localtonet.com/download/localtonet-osx-arm64.zip -o localtonet-osx-arm64.zip
    unzip localtonet-osx-arm64.zip -d ~/localtonet
    chmod 755 ~/localtonet/localtonet
    Intel
    curl -L https://localtonet.com/download/localtonet-osx-64.zip -o localtonet-osx-64.zip
    unzip localtonet-osx-64.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. 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.

Run as a launchd service #

A service starts Localtonet on every boot, keeps it running after you log out and does not need an open terminal. The service commands need root, so run them with sudo.

  1. Install the service #

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

    The command registers a system-wide launchd job for this token and starts it right away. It answers with the name of the job:

    [CLI] Installed service 'Localtonet_<TOKEN_PREFIX>'

    <TOKEN_PREFIX> is the first 9 characters of your token. Every token gets its own job, 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 job answers [CLI] Service 'Localtonet_<TOKEN_PREFIX>' status: Running. In the dashboard, the token shows Online under My Tokens.

What the install creates #

ItemLocation
launchd job definition/Library/LaunchDaemons/Localtonet_<TOKEN_PREFIX>.plist
Standard output of the client/var/log/Localtonet_<TOKEN_PREFIX>.out.log
Error output of the client/var/log/Localtonet_<TOKEN_PREFIX>.err.log

The job starts when the Mac boots, and launchd starts the client again when it exits with an error. The job runs the localtonet file from the path it had when you installed the service, with the token as part of its arguments.

Service commands #

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

CommandWhat it does
--install-serviceWrites the job definition, loads it and starts the client.
--start-serviceStarts the job. If it is already running, launchd restarts it.
--stop-serviceStops the client. The job stays installed and starts again on the next boot.
--status-servicePrints the state, for example Running, Stopped, NotFound or Error.
--remove-serviceStops the job, unloads it and deletes the job definition.

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

Upgrade #

  • Homebrew: brew upgrade localtonet
  • Manual install: download the current archive and replace the localtonet file.

If Localtonet runs as a service, install the service again after a Homebrew upgrade: remove it, then install it with the same token. Installing also starts it.

Terminal
brew upgrade localtonet
sudo localtonet --remove-service --authtoken <YOUR_TOKEN>
sudo localtonet --install-service --authtoken <YOUR_TOKEN>

The job keeps the path of the file it was installed from. After a manual upgrade that leaves the client in the same place, it is enough to stop the service with --stop-service, replace the file and start the service with --start-service. Run as a service describes these commands.

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. Remove the client. With Homebrew: brew uninstall localtonet, and brew untap localtonet/tap to remove the tap. After a manual install, delete the localtonet file.

Troubleshooting #

Install failed: 'macOS launchd service installation (system level default).' requires elevated (admin/root) privileges.

The command ran without root. Repeat it with sudo.

sudo: localtonet: command not found

sudo does not find the client in its own search path. Give the full path instead. command -v localtonet prints it, for example:

Bash
sudo "$(command -v localtonet)" --install-service --authtoken <YOUR_TOKEN>

After a manual install without the PATH step, the path is ~/localtonet/localtonet.

Install failed: Plist 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 is installed but the token stays Offline

Read the error log of the job, /var/log/Localtonet_<TOKEN_PREFIX>.err.log, and check that the localtonet file still exists at the path it had when you installed the service.

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 Mac already runs with the same token. Close it, or start this one with a different token. Use one running client per token.

Pomoc