Self-Host Swetrix Community Edition with Docker
Install Swetrix Community Edition with Docker, verify the dashboard and API locally, then reach them remotely over HTTPS with a Localtonet HTTP tunnel.
In this article 12 sections

Run your own cookieless analytics stack, confirm it works on your machine, then make the dashboard and tracking API reachable over HTTPS
Swetrix is an open source, privacy-first web analytics platform that you can use as a hosted cloud service or self-host as Community Edition. The self-hosted path uses Docker to run the Swetrix API and dashboard UI alongside ClickHouse and Redis, with an optional private S3-compatible bucket for session replay recordings. This guide explains how the pieces fit together, what to prepare, how to install and verify the stack locally, how to run and troubleshoot it, and how the tracking script on your websites reaches your instance. It ends with publishing the working dashboard and API through a Localtonet HTTP tunnel, so browsers outside your network can reach them without router port forwarding or a public IP address.
📋 What's in this guide
Why self-host Swetrix Community Edition
Swetrix positions itself as a cookieless alternative to Google Analytics. Its tracking works without cookies or personal data, which means site owners do not need to show a cookie consent banner just to measure traffic. The dashboard focuses on the metrics most teams actually use: visitors, pageviews, referrers, countries, devices and top pages, reported without sampling. On top of basic traffic analytics, the project describes custom events and goals, UTM campaign tracking, alerts, bot blocking, real-user performance monitoring, JavaScript error tracking, session analysis, session replays, funnels, experiments and feature flags, and a proof-of-work reCAPTCHA alternative.
The project is open source under the AGPLv3 license and can be self-hosted free of charge. That gives you two practical choices. The hosted Swetrix cloud handles infrastructure for you on a paid subscription with a free trial. Community Edition (CE) lets you run the same open source codebase on your own server, laptop, home lab box or virtual machine. Self-hosting is attractive when you want full ownership of raw analytics data, when your compliance team prefers that visitor data never leaves your infrastructure, when you want to audit the code you run, or simply when you want to learn how a modern analytics pipeline works.
Self-hosting also introduces a networking problem that many tutorials skip. Analytics only works if visitors' browsers can send events to your Swetrix API. If your instance runs on a machine behind a home router, a corporate NAT or a cloud VM without a public address, the tracking script embedded on your public websites cannot reach it. Your dashboard is also stuck on the local network. That gap is where our platform fits: with Localtonet, an outbound connection from your machine provides a public HTTPS address for a local HTTP service, without inbound port forwarding or firewall changes. We cover that integration as a separate step, after the Swetrix stack is installed and verified locally.
How the Swetrix Community Edition stack fits together

Before running any command, it helps to know what you are deploying. According to the Swetrix repository, self-hosting Community Edition with Docker means deploying the Swetrix API and the Swetrix UI, and connecting them to ClickHouse and Redis. Session replay recordings additionally require a private S3-compatible storage bucket. Each component has a distinct role, and most installation problems trace back to one of them not being reachable by another.
The Swetrix API
The API is the backend. It receives events from the tracking script embedded in your websites, stores and queries analytics data, and serves the data the dashboard displays. From a networking perspective, this is the most important component to expose correctly, because every visitor's browser on every tracked website must be able to send requests to it. If the API is only reachable on your LAN, you will only ever see analytics from your LAN.
The Swetrix UI
The UI is the dashboard you open in a browser to create projects, read reports, watch replays and manage settings. Only you and your team need to reach it, so its exposure requirements are different from the API. You might keep it local, reach it through a private network, or publish it with access controls.
ClickHouse
ClickHouse is a column-oriented database designed for fast analytical queries over large volumes of event data. Swetrix uses it as its analytics data store. In general, ClickHouse benefits from fast disks and enough memory, and its data volume grows with your traffic. Treat its storage as the part of the stack you must back up and monitor for disk usage.
Redis
Redis is an in-memory data store commonly used for caching, sessions, queues and short-lived state. Swetrix requires it as part of the CE deployment. The repository material we reviewed does not describe exactly which Swetrix functions depend on Redis, so we do not speculate here; what matters for installation is that the API must be able to connect to it.
S3-compatible storage for session replays
Session replays produce recordings that are stored separately from regular analytics events. The Swetrix README states that a private S3-compatible bucket is needed for replay recordings and points to a dedicated session replay storage guide. "S3-compatible" means any object storage that speaks the Amazon S3 API, which includes Amazon S3 itself and many self-hosted or commercial alternatives. The bucket should be private, since recordings capture how real users interacted with your pages. If you do not need replays, you can plan the rest of the installation first and add storage later.
| Component | Role in Swetrix CE | Who must reach it |
|---|---|---|
| Swetrix API | Receives tracking events, serves data to the dashboard | Visitors' browsers on every tracked site, plus the UI |
| Swetrix UI | Web dashboard for reports and settings | You and your team |
| ClickHouse | Analytics data store | The API only, never the public internet |
| Redis | Required supporting data store | The API only, never the public internet |
| S3-compatible bucket | Storage for session replay recordings | The API; keep the bucket private |
Only the API and, optionally, the UI should ever be exposed outside the host. ClickHouse and Redis belong on the internal Docker network. Do not create tunnels or published ports for them "just to test", because a reachable database is one of the most common ways self-hosted services get compromised.
Prerequisites for a Docker-based Swetrix install
The official self-hosting guide at swetrix.com/docs/selfhosting/how-to is the authoritative reference for exact version requirements and hardware sizing. The material we verified establishes the shape of the deployment rather than precise minimums, so in this section we separate what is confirmed from what you should check before you start.
Confirmed requirements
- Docker. Community Edition is self-hosted with Docker. You need a working Docker Engine on the host.
- A way to run multiple containers together. The deployment consists of the API, the UI, ClickHouse and Redis. Multi-container setups like this are normally orchestrated with Docker Compose, and the official guide provides the configuration to use.
- A private S3-compatible bucket, only if you want session replays.
Things to check before installing
- Host operating system and CPU architecture. We have not verified which architectures the official images support. If you plan to run on ARM hardware such as a Raspberry Pi, confirm image availability in the official guide first.
- Memory and disk. ClickHouse is the heaviest component. Exact recommendations are not part of the evidence we reviewed, so size the machine according to the official guide and your expected event volume, and leave room for growth.
- Free local ports. The API and UI will listen on local ports defined by the official configuration. Make sure nothing else on the host already uses them.
- Time and patience for configuration. Self-hosted analytics requires environment settings such as service connection details and secrets. The official guide lists the exact variables; we deliberately do not reproduce or guess them here.
Check that Docker is ready
These are standard Docker commands, not Swetrix-specific ones. They confirm that the Docker Engine and the Compose plugin are installed and that your user can talk to the Docker daemon.
docker --version
docker compose version
docker run --rm hello-world
If docker compose version fails but an older docker-compose binary exists, you are on the legacy standalone Compose tool. The commands in this guide use the modern docker compose plugin syntax; follow whatever the official Swetrix guide specifies if it differs. If hello-world fails with a permission error on Linux, your user is not allowed to access the Docker socket. Either run Docker commands with sudo or follow Docker's post-installation instructions for managing Docker as a non-root user.
The Swetrix README links to the official self-hosting guide for install commands, the compose configuration and environment variables, but those details are not part of the evidence we verified for this article. Rather than invent ports, image names or variable names that may be wrong or outdated, we walk through the documented structure and give you generic, safe Docker commands to install, verify and operate whatever configuration the official guide provides.
Install Swetrix Community Edition with Docker
The installation follows the same pattern as most Compose-based self-hosted applications: obtain the official configuration, fill in your settings, pull the images, start the stack and watch it come up. The steps below describe that flow and highlight what to pay attention to at each stage.
1. Create a dedicated working directory
Keep the Swetrix configuration in its own directory. Docker Compose uses the directory name as the default project name, and keeping everything together makes upgrades, backups and teardown predictable.
mkdir -p ~/swetrix
cd ~/swetrix
2. Obtain the official configuration
Open the official Swetrix self-hosting guide and follow its instructions to obtain the Docker configuration for Community Edition. Place the files it provides in this directory. Use the configuration from the official guide rather than one copied from a forum post or an old blog, because analytics stacks evolve and service names, image tags and required variables change between releases.
3. Configure environment settings
Self-hosted Swetrix needs settings that tell the API how to connect to ClickHouse and Redis, plus any secrets the application uses. When you fill these in, keep a few general rules in mind:
- Generate long, random secrets instead of reusing example values from documentation.
- Keep the environment file out of version control and restrict its file permissions, for example with
chmod 600on Linux and macOS. - When services run on the same Docker Compose network, containers usually reach each other by service name rather than by
localhost. Inside a container,localhostrefers to that container itself. Use the hostnames the official configuration expects. - If you are enabling session replays, configure the S3-compatible bucket details according to the official session replay storage guide, and use credentials that are scoped only to that bucket.
4. Validate the configuration before starting
Docker Compose can render the final configuration with variables substituted. This is a quick way to catch typos, missing variables and indentation errors before any container starts.
docker compose config
Warnings about unset variables at this stage almost always mean something is missing from your environment file. Fix them now; services that start with empty connection settings tend to fail in confusing ways later.
The rendered configuration includes every substituted value, including secrets and storage credentials. Never paste it into a public issue, chat or support ticket without redacting it first.
5. Pull images and start the stack
docker compose pull
docker compose up -d
pull downloads the images referenced by the official configuration, and up -d creates and starts all services in the background. The first start can take a while, mainly because ClickHouse initializes its storage and the API may need to wait for its dependencies to accept connections.
6. Watch the startup logs
docker compose logs -f
Follow the combined logs until the services settle. You are looking for the API reporting that it has started and connected to its data stores, and for the absence of repeated restart loops or connection-refused errors. Press Ctrl+C to stop following; this does not stop the containers.
Verify the dashboard and API locally

Always prove that Swetrix works on the host before you think about remote access. If something is broken locally, a public URL will only make it harder to diagnose. Verification has three layers: containers are running, the HTTP endpoints respond, and the application behaves correctly end to end.
Check container status and published ports
docker compose ps
Every service should show a running state. Look for anything marked as restarting or exited. The output also shows published ports in the form 0.0.0.0:HOSTPORT->CONTAINERPORT/tcp or 127.0.0.1:HOSTPORT->CONTAINERPORT/tcp. The host port on the left is what you connect to from the host itself. Note the host ports for the UI and the API; you will need both later. This is the reliable way to discover them, because they are defined by the official configuration rather than by this article.
Also check that ClickHouse and Redis do not have host ports published to 0.0.0.0. If they do and you do not need direct access, remove those published ports, or bind them to 127.0.0.1 only.
Check that the endpoints respond
Replace the placeholders with the host ports you found in the previous step.
curl -I http://127.0.0.1:<UI_PORT>
curl -I http://127.0.0.1:<API_PORT>
Any HTTP response, even a 404 on the API root, proves that something is listening and answering HTTP. "Connection refused" means nothing is listening on that port, and a hang usually points to a firewall or a service still starting. The specific API health or status routes are not part of the evidence we reviewed, so treat any HTTP response as the signal for this step and rely on the next step for functional proof.
Verify the application end to end
- Open the UI in a browser on the host using
http://127.0.0.1:<UI_PORT>. - Create the initial account and sign in, following the official guide for first-run setup.
- Create a project for a test website. Swetrix gives each project an ID that the tracking script uses.
- Open your browser's developer tools on the dashboard and check the Network tab. Requests to the API should succeed rather than fail with connection or CORS errors. Failed requests here are the clearest sign that the UI cannot reach the API at the address it is configured to use.
Once the dashboard loads data from the API without errors, the core installation is complete. The remaining question is how real visitors' browsers will reach your API, which is the subject of the next two sections.
Add the Swetrix tracking script to a website
Swetrix collects data through a lightweight tracking script of a few kilobytes. It drops into any CMS, framework or custom stack, and the project lists integrations ranging from WordPress, Ghost and Shopify to Next.js, Nuxt, SvelteKit, Django, Laravel and Ruby on Rails. There is nothing to migrate and no large SDK to learn: you initialize the tracker with your project ID and tell it to track page views.
The latest release of the tracker library at the time of writing is tracker-js@4.8.0. Its headline change is automatic outbound link tracking. Outbound link tracking is disabled by default and is enabled at initialization like this:
swetrix.init('YOUR_PROJECT_ID', {
events: {
outboundLinks: true,
},
})
swetrix.trackViews()
Replace YOUR_PROJECT_ID with the ID of the project you created in your dashboard. With outbound tracking on, clicks on external links appear under Traffic → Pages → Outbound links, separately from custom events. According to the release notes, tracking handles dynamically added links, nested elements and middle-clicks, and it does not delay navigation.
Pointing the tracker at your self-hosted API
By default, a tracking library built for a hosted service sends events to that service's API. A self-hosted instance needs the tracker to send events to your own API address instead. Swetrix's tracker documentation describes how to configure this for self-hosted deployments. That specific option is not part of the evidence we verified, so we do not show it here; check the official tracker and self-hosting documentation for the exact setting before you deploy the snippet.
Whatever the setting is called, the value you put in it must be an address that a visitor's browser can reach from the public internet over HTTPS. A value like http://127.0.0.1:<API_PORT> works only on your own machine. A LAN address works only on your network. Modern browsers also block requests from an HTTPS page to a plain HTTP endpoint as mixed content, so a public HTTPS address is effectively required for tracking real websites.
Every website you track will have your API address embedded in its tracking configuration. Changing the address later means updating every site. If you plan to track production websites for a long time, prefer a stable address, such as a custom subdomain or your own custom domain, over a randomly generated one.
Reach Swetrix remotely with a Localtonet HTTP tunnel

With Swetrix running and verified locally, you can make it reachable from outside your network. Our platform works by having the Localtonet client on your machine open an outbound connection to a Localtonet relay server. An HTTP tunnel then gives a local IP address and port a public HTTPS address. You do not need inbound router port forwarding, firewall changes, VPN setup or a public IP address on the host. The tunnel is available only while the client is connected and the tunnel is running.
Plan which services to publish
Because Swetrix's UI and API listen on separate local ports, think of them as separate publishing decisions:
| Goal | What to publish | Notes |
|---|---|---|
| Track real public websites | An HTTP tunnel to the API's local port | Required so visitors' browsers can send events. Use a stable address for production sites. |
| Open the dashboard from anywhere | An HTTP tunnel to the UI's local port | The UI must also be able to reach the API at an address your remote browser can resolve. |
| Test Swetrix on a staging site | A temporary API tunnel with a random subdomain | Fine for short tests; stop or delete the tunnel afterward. |
| Use the dashboard only at home | Nothing for the UI | Keep the UI on your LAN and publish only the API. |
One limitation deserves to be stated plainly. When the dashboard is opened remotely, it needs to call the API at an address the remote browser can reach. How Swetrix's UI is told the API's address is defined in the official self-hosting configuration, and we have not verified that detail. If the remote dashboard loads but shows no data or network errors, the UI is most likely still configured to call a local API address. Update that setting to your public API URL as described in the official guide, then restart the stack.
Create the HTTP tunnel
The steps below follow the standard Localtonet HTTP tunnel workflow. Field labels can change as the dashboard evolves, so keep the Localtonet HTTP tunnel documentation open alongside this guide for the current screens. Repeat the process for each Swetrix service you decided to publish.
Install the Localtonet client on the Swetrix host
Install the Localtonet app for your operating system on the machine running the Docker stack, or on a device that can reach its ports, and connect it using that device's auth token from your dashboard. Tokens are device-specific; never share or commit them.
Open the HTTP tunnel page
In the Localtonet dashboard, go to the HTTP tunnel section to create a new HTTP/s tunnel.
Select the Process Type
Choose Random Sub Domain, Custom Sub Domain or Custom Domain. All three serve your service at a public HTTPS address. For a tracking API embedded in production websites, a custom subdomain or custom domain keeps the address stable.
Select the AuthToken and server
Pick the auth token of the device running Swetrix and choose a relay server from the options available in your dashboard.
Enter the local IP and port
Enter 127.0.0.1 if the client runs on the same host, and the host port for the API or UI that you found with docker compose ps. If the client runs on another device, use the Swetrix host's LAN IP instead.
Start the tunnel and copy the public URL
Creating a tunnel does not start it. Press Start, then copy the assigned HTTPS address. Use the API tunnel's address in your tracking configuration, and the UI tunnel's address to open the dashboard remotely.
Custom domains involve DNS records on your side. Check the current Localtonet documentation for the exact DNS requirements before you change records, since we do not reproduce them here.
Verify the public path
- From a device outside your network, for example a phone on mobile data, run
curl -I https://<your-api-tunnel-address>or open it in a browser. You should get the same kind of HTTP response you saw locally. - Configure the tracker on a test website to use the public API address, load a page on that site, and check that a page view appears in your Swetrix dashboard.
- If you published the UI, open its public address remotely, sign in and confirm in the browser's Network tab that API calls go to your public API address and succeed.
Keep the tunnel available
Analytics only records what the API receives. If the Localtonet client disconnects or the tunnel is stopped, visitors' events cannot reach your instance during that time. For long-running tracking, run the client on an always-on machine and monitor its state. Our platform-wide webhooks can help: a Token/Tunnel webhook fires when a token or tunnel in a selected Token Group changes to Connected or Disconnected, and sends a JSON body with Id, ActionDate, Type ("Token" or "Tunnel") and Status ("Connected" or "Disconnected"). See the
Localtonet webhook documentation
to route those notifications to your alerting system.
A tunnel makes your service reachable; it does not add or bypass authentication. Before publishing the Swetrix UI, use a strong unique password for the admin account, disable or restrict registration if the official guide supports it, keep Swetrix updated, and publish the UI only when you actually need remote access. Stop or delete tunnels you no longer use.
Security and privacy checklist
Self-hosting moves responsibility for the analytics data from a vendor to you. The cookieless design of Swetrix reduces how much personal data you collect in the first place, but the server, the databases and any replay recordings still need protection.
- Expose the minimum. The API is the only component that must be public for tracking. The UI can stay private unless you need remote access. ClickHouse and Redis must never be public.
- Protect secrets. Generate random secrets, restrict the environment file's permissions, and keep it out of Git and backups that others can read.
- Treat replays as sensitive. Session replays record how real people used your pages. Keep the S3-compatible bucket private, use credentials scoped to that bucket, and consider whether you need replays on every page.
- Use bot filtering. Swetrix offers basic and strict bot filters that block bot traffic, datacenter IPs, spam referrers and probes. A public API endpoint will receive automated traffic, so enabling filtering keeps reports clean.
- Patch regularly. Update the Swetrix images when new releases ship, as well as the host OS and Docker itself.
- Back up. Your analytics history lives in ClickHouse volumes. Back them up on a schedule you have actually tested restoring.
Day-to-day operations
Once the stack is running, most routine tasks use standard Docker Compose commands run from the ~/swetrix directory. These commands are generic to Docker Compose and work with whatever service names the official configuration defines.
| Task | Command | What it does |
|---|---|---|
| Check status | docker compose ps |
Lists services, their state and published ports |
| Follow logs | docker compose logs -f <service> |
Streams logs for one service, or all services if omitted |
| Restart a service | docker compose restart <service> |
Restarts containers without recreating them |
| Apply config changes | docker compose up -d |
Recreates services whose configuration changed |
| Stop the stack | docker compose down |
Stops and removes containers and networks; named volumes are kept |
| Check disk usage | docker system df |
Shows space used by images, containers and volumes |
docker compose down -v also deletes named volumes, which can include your ClickHouse analytics data. Only use it when you intentionally want to wipe the installation.
Upgrading Swetrix
A typical Compose upgrade looks like the sequence below. Before upgrading, back up your data volumes and read the Swetrix release notes for any migration steps or configuration changes; analytics databases sometimes require schema migrations that the release notes describe.
cd ~/swetrix
docker compose pull
docker compose up -d
docker compose logs -f
After the upgrade, repeat the verification steps: check docker compose ps, load the dashboard, and confirm new page views arrive. Your Localtonet tunnels do not need to change as long as the host ports stay the same.
Start on boot
Docker can restart containers automatically after a reboot if the Compose file sets a restart policy such as unless-stopped on each service and the Docker daemon itself starts at boot. Check whether the official configuration already sets restart policies. The Localtonet client must also be running after a reboot for the tunnels to come back, so make sure it starts with the machine.
Troubleshooting common problems
Most issues fall into a handful of categories. Work from the inside out: containers first, then local HTTP, then the application, then the public path.
A container keeps restarting
Run docker compose ps to identify it and docker compose logs <service> to read why it exits. The usual culprits are a missing or misspelled environment variable, a dependency that is not reachable yet, or insufficient memory. Re-run docker compose config to check for unset variables, and check memory pressure on the host, since ClickHouse is memory-hungry.
The API cannot connect to ClickHouse or Redis
Connection-refused or host-not-found errors in the API logs usually mean the API is pointing at the wrong hostname. Within a Compose network, use the service names defined in the configuration, not localhost or 127.0.0.1. Also confirm the database containers are running and healthy before the API starts trying to connect.
"Port is already allocated" on startup
Another process or container already uses one of the host ports. Find it with sudo lsof -i :<port> or ss -ltnp on Linux, then either stop that process or change the host side of the port mapping in your configuration. If you change a port, update the matching Localtonet tunnel's local port too.
The dashboard loads but shows no data
Open the browser's developer tools and look at the Network tab. Failed requests to an API address show you where the UI is trying to connect. If it is calling a local address while you are browsing remotely, the UI's API address setting needs to point to the public API URL. CORS errors indicate the API is reachable but rejecting the origin; check the official guide for how allowed origins are configured.
The tracking script sends no events
- Confirm the project ID in
swetrix.initmatches the project in your dashboard. - Confirm the tracker is configured to send events to your self-hosted API rather than the default hosted endpoint.
- Check that the API address is HTTPS when the tracked site is HTTPS, to avoid mixed-content blocking.
- Test from your own browser with privacy extensions disabled, since content blockers can block analytics scripts and requests.
- Make sure the Localtonet tunnel for the API is started and the client is connected.
The public URL does not respond
First confirm the local endpoint still answers with curl -I http://127.0.0.1:<port> on the host. If it does, check in the Localtonet dashboard that the tunnel is started, that the selected auth token belongs to the device that is actually online, and that the local IP and port match. If the Localtonet client runs on a different machine than Docker, make sure the Swetrix port is published on an interface that machine can reach, not just 127.0.0.1.
Outbound link clicks do not appear
Outbound link tracking is disabled by default. It requires the tracker version that includes the feature (introduced in tracker-js@4.8.0) and events: { outboundLinks: true } in the init options. Look for the clicks under Traffic → Pages → Outbound links, not among custom events.
Swetrix Cloud vs self-hosted Community Edition
Choosing between the hosted service and self-hosting is mostly a trade-off between convenience and control. The Swetrix repository includes a comparison table of Cloud and CE features, but we have not verified its full contents, so we do not claim which specific features are available in CE. Check that table in the official repository before choosing CE for a feature you depend on.
| Aspect | Swetrix Cloud | Community Edition (self-hosted) |
|---|---|---|
| Cost | Paid plans with a 14-day free trial; a payment method is required for the trial | Free of charge; you pay for your own hardware or hosting |
| Infrastructure | Managed by Swetrix | You run the API, UI, ClickHouse, Redis and optional S3 storage |
| Data location | Swetrix's infrastructure | Your infrastructure |
| Public reachability | Handled by the service | Your responsibility, for example through a Localtonet HTTP tunnel |
| Feature set | Varies by plan; session replays, feature flags and A/B testing are listed on the Plus plan | Check the official Cloud vs CE table for current availability |
Swetrix also lists an Enterprise tier with on-premise installation and a dedicated isolated instance, which is a different offering from the free Community Edition described in this guide.
Frequently asked questions
Is Swetrix Community Edition free to self-host?
Yes. Swetrix is open source under the AGPLv3 license and can be self-hosted on your own infrastructure free of charge. Your costs are the hardware or hosting you run it on, plus any S3-compatible storage you use for session replays.
What services does a Swetrix self-hosted install need?
The Docker deployment runs the Swetrix API and the Swetrix UI, connected to ClickHouse and Redis. Session replay recordings additionally require a private S3-compatible bucket.
Which ports do the Swetrix API and UI use?
The ports are defined by the official Docker configuration, and we have not verified their default values, so we do not state them. After starting the stack, run docker compose ps to see exactly which host ports are published for each service.
Why does my self-hosted Swetrix API need to be public?
The tracking script runs in your visitors' browsers and sends events directly to your API. If the API is only reachable on your machine or LAN, events from real visitors never arrive. A Localtonet HTTP tunnel gives the local API port a public HTTPS address without port forwarding.
Do I need to publish the dashboard too?
No. Only the API must be public for tracking. Publish the UI with a second HTTP tunnel only if you want to open the dashboard from outside your network, and protect it with a strong admin password.
What happens to tracking if the Localtonet tunnel stops?
A tunnel is only available while the client is connected and the tunnel is running. While it is down, visitors' events cannot reach your API. Run the client on an always-on machine and use Localtonet Token/Tunnel webhooks to get notified of Connected and Disconnected changes.
How do I enable outbound link tracking?
Since tracker-js@4.8.0, pass events: { outboundLinks: true } to swetrix.init. It is disabled by default. Clicks appear under Traffic → Pages → Outbound links, separately from custom events.
Is a Localtonet HTTP tunnel the same as a VPN?
No. An HTTP tunnel publishes one local HTTP service at a public HTTPS address. If you want private access to your network instead, our VPN Manager is the separate private mesh VPN feature.
Publish your self-hosted Swetrix with Localtonet
Your analytics stack is running and verified locally. Create a free Localtonet account, connect the host, and start an HTTP tunnel so the tracking script on your websites can reach your Swetrix API over HTTPS.
Get Started Free →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.