8 min read

How to Start Localtonet Automatically

Run Localtonet as a background service so your tunnels start automatically on every boot. Step-by-step setup for Windows, Linux and macOS

⚙️ Service Mode · Windows · Linux · macOS · Auto-Start

Start Localtonet Automatically on System Boot

By default, Localtonet stops when you close the terminal. Running it as a background service means your tunnels come back online automatically every time your machine restarts no manual intervention, no forgotten sessions. This guide covers every platform: Windows, Linux (systemd), and macOS (launchd).

🪟 Windows Service 🐧 Linux systemd 🍎 macOS launchd ⏱ 5 min setup

Why Run Localtonet as a Service?

When you run Localtonet manually from a terminal, it stops the moment you close that terminal window or when the machine reboots. For most development and testing use cases that's fine. But if you're running a production webhook endpoint, a self-hosted API, a game server, or any service that needs to be reachable 24/7, you need Localtonet to start automatically in the background without any manual steps.

Service Mode
  • Starts automatically on every boot
  • Runs in the background with no terminal
  • Survives user logout and session end
  • Managed by the OS (Windows Service / systemd / launchd)
  • Restarts automatically if it crashes
Manual Terminal Run
  • Stops when you close the terminal
  • Stops on every system restart
  • Requires you to be logged in
  • Easy to forget to restart after reboot
🔁 Always-on tunnels Webhook endpoints, APIs, and game servers stay reachable even after a power cut or unattended reboot.
🖥️ Headless servers Perfect for VPS, home servers, and Raspberry Pi where there is no permanent terminal session.
🔒 OS-managed reliability Windows Service Manager, systemd, and launchd all provide automatic restart on failure without extra configuration.
📋 Centralised logging Logs go to the OS log system Windows Event Viewer, journald, or macOS Console for easy monitoring.

Before You Start

✅ Checklist

  • ☑️  Localtonet is already installed on your machine. If not, see the download page.
  • ☑️  You have your AuthToken from Dashboard → My Tokens.
  • ☑️  You have administrator / sudo privileges on the machine.
  • ☑️  On Linux: systemd must be available. Termux does not support service mode.
Administrator privileges are required

Installing and managing system services requires elevated permissions. On WindowsRun Command Prompt or PowerShell as Administrator. On Linux and macOSPrefix commands with sudo

Step 1 — Install Localtonet as a Service

The same single command works on all three platforms. Localtonet detects the OS automatically and registers the correct service type Windows Service, systemd unit, or launchd job.

sudo localtonet --install-service --authtoken <YOUR_TOKEN>
What this does on each platform

Windows — Registers a Windows Service visible in services.msc.
Linux — Creates a systemd unit file at /etc/systemd/system/localtonet.service.
macOS — Sets up a launchd job in ~/Library/LaunchAgents/.

Step 2 — Start, Stop, Check Status, and Remove

After installing the service, use these commands to manage it. All commands work identically on Windows, Linux, and macOS.

1

Start the service

Starts Localtonet as a background service and enables auto-start on every subsequent boot.

sudo localtonet --start-service --authtoken <YOUR_TOKEN>
2

Stop the service

Stops the running Localtonet service. Your tunnels will go offline until the service is started again.

sudo localtonet --stop-service --authtoken <YOUR_TOKEN>
3

Check service status

Returns the current status of the service whether it is running, stopped, or failed.

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

Remove the service

Stops and completely unregisters the service from the OS. Localtonet will no longer auto-start on boot.

sudo localtonet --remove-service --authtoken <YOUR_TOKEN>
That's it for the setup

Once you have run --install-service followed by --start-service, Localtonet will start automatically on every subsequent boot. You don't need to run any command again unless you want to stop, update, or remove the service.

Updating Localtonet When a New Version Is Released

Stop the service, replace the binary with the latest version, then start it again. The service registration does not need to be repeated.

# 1. Stop the running service
sudo localtonet --stop-service --authtoken <YOUR_TOKEN>

# 2. Update the binary (Linux one-liner)
curl -fsSL https://localtonet.com/install.sh | sh

# 3. Start the service again
sudo localtonet --start-service --authtoken <YOUR_TOKEN>
macOS Homebrew users

Updating is simpler via Homebrew. Run brew upgrade localtonet, then restart the service with sudo localtonet --start-service --authtoken <YOUR_TOKEN>

Troubleshooting

🪟 "Access Denied" on Windows

You must run Command Prompt or PowerShell as Administrator. Right-click the Start menu → Terminal (Admin) or Command Prompt (Admin), then run the command again.

🪟 Service not appearing in services.msc

Make sure you ran --install-service with the correct AuthToken and Administrator privileges. If still missing, remove it with --remove-service and reinstall. Check Windows Event Viewer under Windows Logs → Application for error details.

🐧 Service fails to start on Linux

Check the detailed error output with the command below. Common causes: incorrect AuthToken, binary not in PATH, or missing execute permission  fix with chmod 755 /usr/local/bin/localtonet

🐧 Termux service mode not supported

Termux does not use systemd, so --install-service and related commands are unavailable. On Android, use the official Localtonet app from Google Play instead.

🍎 launchd job not starting on macOS

Confirm the plist file exists in ~/Library/LaunchAgents/. If missing, run --remove-service then --install-service again. Check macOS Console.app for launchd errors related to Localtonet.

🔑 AuthToken changed or rotated

If you rotate or revoke your AuthToken, the service will stop authenticating. Remove the old service with --remove-service, then reinstall with your new token.

Command Reference

Command flag What it does Platform
--install-serviceRegisters Localtonet as an OS service (does not start it yet)Windows · Linux · macOS
--start-serviceStarts the service and enables auto-start on bootWindows · Linux · macOS
--stop-serviceStops the running serviceWindows · Linux · macOS
--status-serviceShows the current service statusWindows · Linux · macOS
--remove-serviceStops and unregisters the service completelyWindows · Linux · macOS
systemctl status YOURSERVICENAME
Detailed systemd status and recent logsLinux only
journalctl -u YOURSERVICENAME -f
Follow live service logsLinux only
launchctl list | grep YOURSERVICENAME
Check if the launchd job is registeredmacOS only
Get-Service -Name "YOURSERVICENAME"Check Windows Service status via PowerShellWindows only
--install-service
DoesRegisters servicePlatformAll
--start-service
DoesStarts + auto-bootPlatformAll
--stop-service
DoesStops servicePlatformAll
--status-service
DoesShows current statusPlatformAll
--remove-service
DoesUnregisters servicePlatformAll

Frequently Asked Questions

Do I need to run --install-service every time I restart the machine?

No. You only run --install-service once. After that, Localtonet starts automatically on every boot without any further commands needed.

Which tunnels start automatically — all of them or only some?

The tunnels that were in Start state in the dashboard are the ones that activate automatically. Tunnels you have stopped from the dashboard remain stopped.

Does service mode work on Raspberry Pi or ARM Linux?

Yes. Localtonet provides ARM and ARM64 Linux builds. Install the correct binary for your architecture, then use the same --install-service command. Raspberry Pi OS uses systemd, so the setup is identical to any other Linux distribution.

Does service mode work on Termux (Android)?

No. Termux is not systemd-based, so service commands are not supported. For persistent background operation on Android, use the official Localtonet app from Google Play.

Can I run --install-service without sudo on Linux?

No. Writing the systemd unit file to /etc/systemd/system/ requires root privileges. Once installed however, the service runs as a system-level process and does not require you to stay logged in as root.

What happens if my AuthToken changes?

The service will stop authenticating. Remove it with --remove-service, then reinstall using your new token: --install-service --authtoken <NEW_TOKEN>.

Keep Your Tunnels Online Around the Clock

Two commands are all it takes --install-service and --start-service. After that, Localtonet handles the rest on every boot automatically.

Download Localtonet →
auto-start service mode systemd launchd windows service linux localhost boot startup background service raspberry pi

Localtonet is a secure multi-protocol tunneling and proxy platform designed to expose localhost, devices, private services, and AI agents to the public internet supporting HTTP/HTTPS tunnels, TCP/UDP forwarding, mobile proxy infrastructure, file server publishing, latency-optimized game connectivity, and developer-ready AI agent endpoint exposure from a single unified control plane.