Docs · DockHive Tunnel

DockHive Tunnel docs

Put an app running on your computer on the internet at https://<name>.dockhive.live, through your DockHive account. Install the dockhive CLI, sign in, and expose a port.

Overview

$ dockhive login
$ dockhive expose 3000

The CLI prints your public address and starts a local dashboard:

output
  Forwarding  https://brave-otter-7k2p.dockhive.live  ->  http://localhost:3000
  Region      eu
Dashboard: http://127.0.0.1:4040

HTTPS, WebSockets, server-sent events, streaming responses and large uploads all work. The CLI opens one outbound connection to the DockHive edge, so nothing on your computer listens on a public port: no port forwarding and no public IP needed. If your network drops, the tunnel reconnects by itself and keeps the same URL.

dockhive commands
CommandWhat it does
dockhive loginSign in (opens your browser). --token signs in with an API key; --no-browser prints the link instead.
dockhive whoamiShow the signed-in account and plan.
dockhive logoutSign out and delete the stored credentials.
dockhive expose <target>Share a local app on a public HTTPS URL.
dockhive namesList your reserved names. names release <name> gives one up.
dockhive regionsShow the tunnel regions and their latency from where you are.
dockhive service install|uninstallRun a tunnel in the background at login.
dockhive doctor [port]Check your sign-in, connectivity to every region and, with a port, that your local app answers.
dockhive versionPrint the version and check for a newer release.

Install

macOS and Linux

$ curl -fsSL https://dockhive.io/tunnel/install.sh | sh

Windows (PowerShell)

PS> irm https://dockhive.io/tunnel/install.ps1 | iex

Both scripts download the right build for your system (amd64 or arm64) and verify its SHA-256 checksum before installing it.

  • macOS and Linux install to /usr/local/bin if it's writable, otherwise to ~/.local/bin.
  • Windows installs to %LOCALAPPDATA%\Programs\dockhive.

Your PATH is set automatically. On macOS and Linux the script adds the install directory to your shell profile (~/.zshrc, ~/.bashrc, fish's conf.d or ~/.profile) under a # DockHive Tunnel comment; open a new terminal to use dockhive. On Windows it's added to your user PATH and works in the same window right away.

Install options

Installer environment variables
VariableMeaning
DOCKHIVE_INSTALL_DIRWhere to put the binary.
DOCKHIVE_VERSIONA release tag such as v0.1.0. Default: the latest release.
DOCKHIVE_NO_MODIFY_PATH=1Don't edit shell profiles (macOS and Linux).

Set them for the installer's shell:

$ curl -fsSL https://dockhive.io/tunnel/install.sh | DOCKHIVE_INSTALL_DIR="$HOME/bin" DOCKHIVE_NO_MODIFY_PATH=1 sh
PS> $env:DOCKHIVE_VERSION = "v0.1.0"; irm https://dockhive.io/tunnel/install.ps1 | iex

Check the install with dockhive version. It also tells you (at most once a day) when a newer release exists; nothing updates automatically, so rerun the install line to update.

Sign in

$ dockhive login

Your browser opens the DockHive console. Approve the request and go back to the terminal. Your email address must be verified first. No account yet? Create one free.

$ dockhive whoami
$ dockhive logout

whoami shows who you're signed in as and your plan; logout signs out and deletes the stored credentials.

Servers without a browser

Create an API key in the console under Settings → API keys, then either store it:

$ dockhive login --token dh_pat_...

or use it without storing anything:

$ export DOCKHIVE_TOKEN=dh_pat_...

On a machine that has a browser elsewhere, dockhive login --no-browser prints the sign-in link for you to open yourself.

Expose an app

Pass a port, a host:port on your network, or a local HTTP(S) URL:

examples
dockhive expose 3000                         # http://localhost:3000
dockhive expose 192.168.1.20:8080            # another host on your network
dockhive expose https://localhost:8443       # a local HTTPS server (self-signed is fine)
dockhive expose 5173 --host-header rewrite   # send Host: localhost:5173 to the app
dockhive expose 3000 --region eu             # pick a region
dockhive expose flags
FlagMeaning
--name <name>Use a name you keep: https://<name>.dockhive.live. Paid plans.
--region auto|us|eu|asia|africaauto (the default) picks the fastest region from where you are.
--host-header rewrite|<host>The Host header your app receives. rewrite sends the local address (for example localhost:5173); the default keeps the public hostname.
--dashboard-port 4040Local dashboard port. The next free port is used if it's taken.
--no-dashboardDon't start the local dashboard.
--quietDon't print each request.
--no-failoverStay on the chosen region. By default, if your region goes down the CLI moves to the next-fastest one and keeps your URL.
--log <file|stderr>Write connection logs to a file (or stderr). Pair with --log-level debug|info|warn|error.

Dev servers that only answer to their own hostname (Vite, webpack dev server and similar) usually need --host-header rewrite. Your app receives X-Forwarded-For, X-Forwarded-Proto: https and X-Forwarded-Host headers. Press Ctrl+C to close the tunnel.

Names

  • Free Tier: a random name such as brave-otter-7k2p, kept while the tunnel runs (and for a couple of minutes after a disconnect, so reconnects keep it).
  • Paid plans: --name my-app reserves my-app.dockhive.live for you, in every region, until you release it. While the tunnel is stopped, visitors see a "this tunnel is offline" page.
$ dockhive expose 3000 --name my-app
$ dockhive names
$ dockhive names release my-app

Names are 3 to 40 characters of lowercase letters, digits and -. Names that imitate DockHive, other brands, or sign-in and payment pages are not allowed.

Regions

The DockHive edge runs in four regions: us (United States), eu (Europe, London), asia (Asia, Singapore) and africa (Africa, Johannesburg). With --region auto (the default) the CLI connects to the fastest one from where you are. See them with their latency:

$ dockhive regions

Run in the background

Install a service that runs any dockhive command at login. Everything after -- is the command it runs:

$ dockhive service install -- expose 3000 --name my-app
$ dockhive service uninstall
  • macOS: a launchd agent; logs in ~/Library/Application Support/dockhive/service.log.
  • Linux: a systemd user unit; follow logs with journalctl --user -u dockhive-tunnel -f. Run loginctl enable-linger $USER to keep it running after you log out.
  • Windows: a scheduled task that starts at logon.

Sign in first: the service uses your stored sign-in (or put DOCKHIVE_TOKEN in the unit's environment on servers).

Local dashboard

While dockhive expose runs, open http://localhost:4040 to see:

  • who you're signed in as,
  • your tunnels with their public URLs, with copy buttons,
  • a live log of requests: method, path, status, duration and size (bodies are never recorded),
  • data in and out.

The dashboard only answers on your own computer. Change its port with --dashboard-port or turn it off with --no-dashboard. Your tunnels also appear in the DockHive console under Tunnels.

Plans and limits

Tunnel limits per plan
PlanTunnels at onceNamesVisitors
Free Tier1Random namesVisitors see a one-time safety notice
Developer Plan ($3/month)53 reserved namesNo visitor notice
Scale Plan10050 reserved namesNo visitor notice
  • Tunnel counts are across all regions. When you reach a limit, dockhive tells you what to stop or how to upgrade.
  • Bandwidth beyond your plan allowance is $0.02 per GB, the same rate as the rest of the platform. See pricing.
  • WebSockets, server-sent events and streaming responses are supported. Idle WebSocket connections may be closed after about 100 seconds without traffic, so send a ping or heartbeat if your app keeps quiet connections open.
  • Uploads are limited to 100 MB per request.

Visitor safety notice (Free Tier)

Visitors who open a Free Tier tunnel in a browser see a one-time notice that the site is served from a DockHive user's computer, with a Continue button. API clients, curl and requests with the header dockhive-skip-warning: 1 skip it, so webhooks are delivered normally. Paid plans don't show it.

$ curl -H "dockhive-skip-warning: 1" https://brave-otter-7k2p.dockhive.live/

Files and settings

Config directory per OS
OSConfig directory
macOS~/Library/Application Support/dockhive
Linux~/.config/dockhive (or $XDG_CONFIG_HOME/dockhive)
Windows%AppData%\dockhive

credentials.json in that directory (readable only by you) holds your sign-in. Environment variables:

  • DOCKHIVE_TOKEN: sign in with an API key without storing it.
  • DOCKHIVE_CONFIG_DIR: use another config directory.
  • DOCKHIVE_NO_UPDATE_CHECK=1: don't check for new releases.

Troubleshooting

Visitors see "The tunnel is up, but the local service isn't answering"
The tunnel is connected but nothing answered on the address you exposed. Start your app (or check the port) and reload. For a server that only listens on another interface, expose host:port; for a local HTTPS server, expose https://localhost:<port>.
The app shows "Invalid host header" or the wrong site
Your dev server checks the Host header. Run with --host-header rewrite.
"Connection lost. Reconnecting..."
Your network dropped or the region went away. The CLI reconnects on its own and keeps your URL; if your region stays down it moves to the next-fastest region automatically (turn that off with --no-failover). dockhive regions shows each region's status.
Not signed in, or the wrong account
Run dockhive whoami. Sign in again with dockhive login. If DOCKHIVE_TOKEN is set in your environment, it's used instead of your stored sign-in.
"command not found: dockhive" right after installing
Open a new terminal so it picks up the PATH change, or run the export PATH=... line the installer printed.
A limit was reached
Stop a running tunnel, release a name with dockhive names release <name>, or upgrade your plan.

Run dockhive doctor 3000 (with your app's port) first: it checks your sign-in, every region and your local app, and tells you what to fix. Still stuck? Include its output and dockhive version when you contact us.

Security and acceptable use

  • Every tunnel is served over HTTPS. The CLI only dials out; your computer opens no public ports.
  • Your API keys and credentials.json are as sensitive as a password. Don't commit them or share them.
  • Anyone with your tunnel's URL can reach the app you expose. Don't expose admin panels or data you wouldn't put on the public internet, and stop the tunnel when you're done.
  • Don't use DockHive Tunnel for phishing, malware, impersonating other sites or anything illegal. Tunnels that break these rules can be suspended without notice.
  • Report abuse to [email protected] with the tunnel's URL.

See also the Terms of Service and Privacy Policy.

Uninstall

macOS and Linux

sh
dockhive service uninstall    # if you installed a service
dockhive logout
rm "$(command -v dockhive)"
rm -rf "$HOME/Library/Application Support/dockhive"   # macOS
rm -rf "$HOME/.config/dockhive"                        # Linux

Then delete the # DockHive Tunnel PATH line the installer added to your shell profile.

Windows (PowerShell)

powershell
dockhive service uninstall   # if you installed a service
dockhive logout
$dir = "$env:LOCALAPPDATA\Programs\dockhive"
Remove-Item -Recurse -Force $dir, "$env:APPDATA\dockhive"
$p = ([Environment]::GetEnvironmentVariable("Path", "User") -split ";") | Where-Object { $_ -and $_ -ne $dir }
[Environment]::SetEnvironmentVariable("Path", ($p -join ";"), "User")

Ready to share localhost?

Create a free account and run your first tunnel in a minute.