Step by step
From localhost to public HTTPS
Start the Next.js development server
Run the project normally and confirm it responds at http://localhost:3000 before adding a tunnel.
pnpm devInstall and authenticate Bore
Install the native client, then sign in through the browser flow. You only need to install once per machine.
curl -sL https://bore.dk/install.sh | bash
bore loginExpose port 3000
Start the tunnel. Bore lets you reuse an available namespace or allocate a new one, then prints its public HTTPS URL.
bore up 3000Configure external callbacks
Use the full Bore origin and the real application path in OAuth, webhook, or preview settings. Keep secrets server-side.
https://<namespace>.bore.dk/api/auth/callbackStop or inspect the tunnel
List tunnel state whenever you need the URL. Stopping port 3000 removes the local claim but preserves its reserved namespace for reuse.
bore ls
bore down 3000Use cases
When a public Next.js development URL helps
A tunnel is useful when the caller cannot reach localhost: an OAuth provider returning to a callback, a webhook sender posting an event, a teammate reviewing a branch, or a phone testing the real responsive experience.
Bore terminates HTTPS at its public edge and relays HTTP and WebSocket traffic to the local app. Your Next.js process can remain a normal development server.
- Test secure cookies and production-like redirect origins.
- Open the same build from a phone without relying on a changing LAN address.
- Share a temporary branch preview while your machine and tunnel are online.
- Receive callbacks from services that require a public HTTPS destination.
Configuration
Treat the Bore hostname as an external origin
Set application base URLs, allowed callback URLs, and CORS rules to the exact HTTPS hostname Bore gives you. Do not replace every internal localhost URL: server-to-server dependencies on your machine can continue using localhost.
Environment variable names depend on your auth library and application. The example below is intentionally generic; use the setting documented by your provider.
NEXT_PUBLIC_APP_ORIGIN=https://<namespace>.bore.dk
# Use your auth provider's documented callback/base URL variable.Restart next dev after changing .env.local. Never put signing secrets in variables prefixed with NEXT_PUBLIC_.
Multiple ports
Keep a separate local API on a child hostname
If Next.js runs on port 3000 and a separate API runs on port 3001, reserve a child hostname under the same namespace. The root continues to use the main tunnel port while the child host uses its override.
bore host add <namespace> api
bore host set-port <namespace> api 3001Separate origins make CORS and cookie behavior more production-like. Add only the exact origins your API should accept.
Diagnostics
If the page opens but assets or callbacks fail
First open http://localhost:3000 on the development machine. A failing local request is an application issue; a working local request and failing public request narrows the problem to tunnel state, host validation, or provider configuration.
- Run
bore lsand confirm the namespace is active on the expected device and port. - Check the Next.js terminal for compilation errors and rejected host or origin messages.
- Use the exact HTTPS callback path configured with the external provider.
- Remember that the URL stops serving when the local app, Bore daemon, or machine is offline.
Common questions
Before you expose a port
Does Bore replace the Next.js development server?
No. Next.js still serves the application locally. Bore provides the public HTTPS endpoint and relays traffic to that local port.
Can I use Next.js hot reload through Bore?
Bore relays WebSocket upgrades, which Next.js development features use. If reload fails, check the browser console and Next.js host or origin restrictions for your version.
Is the public URL available when my laptop sleeps?
No. The namespace remains reserved, but requests need an online device, running local server, and connected Bore agent.
Should I expose a production database or admin route?
No. Treat the URL as internet-accessible. Use test data, keep credentials out of the client bundle, and do not expose development tools that assume a trusted network.
Sources and further reading
Run it locally
Put your Next.js branch on a real HTTPS URL
Create an account, authenticate the CLI, and expose port 3000 without changing how Next.js runs locally.