Grain / Learn / From localhost to a URL your agent can keep

Switching guide

From localhost to a URL your agent can keep

Move an agent-built tool from localhost to a lasting URL by creating a Grain workspace, pushing the files, checkpointing the result and choosing a share mode. The published artifact remains available after the local server and coding session stop, with optional Postgres, logins and scheduled jobs for full apps.

Updated 2026-09-04By the Grain team

How people do this today

A coding agent creates a page or app in a local folder, installs dependencies and starts a development server. The developer opens a localhost address and iterates until the result looks useful. Sharing usually means a screenshot, a screen recording, a tunnel to the laptop or a rushed deployment configuration. Each workaround treats the local process as if it were the artifact. It is not. Localhost is only a route back to one machine while one process is alive. The durable thing is the set of files, services, data and access rules that make the result useful. Publishing those pieces as a workspace gives the agent and its readers a stable object to return to.

Where it breaks

  • The address is not an address for anyone else. localhost points to the viewer's own machine. Sending it to a teammate cannot route them to the developer's process.
  • The laptop becomes infrastructure. A tunnel or live screen still depends on the computer staying awake, connected and signed in. Closing the lid ends the handoff.
  • State lives in the wrong place. A local file or development database may contain the only copy of reviewer notes and generated records. A reset, branch change or agent retry can erase it.
  • Access is improvised. A development server normally has no clear public, password-protected or invite-only sharing decision. The team either exposes too much or cannot get in.
  • Updates fork the link trail. Every new recording, tunnel or temporary preview creates another location. Reviewers cannot tell which one reflects the latest agent work.

The replacement workflow

  1. Download the desktop app. Get the Mac app from rungrain.com. The download flow asks for an early-access phrase and provides a request-access form. Windows has a waitlist, and the self-hostable core runs on Linux.
  2. Authenticate the CLI. Run grain login. This establishes the local CLI session before you connect the project folder to a workspace.
  3. Initialize the folder. Run grain init from the project root. It creates the workspace and writes .mcp.json for Claude Code, .codex/config.toml for Codex and .cursor/mcp.json for Cursor. Pass --no-agent-config if you need to skip configuration changes.
  4. Give the agent a complete prompt. For example: Turn this localhost inventory tool into a shareable internal app. Add a responsive item page, a Postgres table for stock changes, login access and a nightly reconciliation job. Remove local-only file paths and keep the data adapter separate. The page, database, login and scheduled job are explicit pieces of the deliverable.
  5. Let the agent write the workspace. The agent changes the files in the initialized folder and can work through MCP. Test the behavior locally, but do not treat the development port as the final share route.
  6. Push the current files. Run grain push. This publishes the workspace contents. Static pages can remain simple artifacts; full apps can include Postgres, logins and scheduled jobs.
  7. Mark the first reviewable state. Run grain checkpoint -m "inventory tool ready for review". The message identifies why this state exists and gives later changes a clear baseline.
  8. Create the URL. Run grain share --public for anyone with the link or grain share --password <pw> for password access. Invite-only access is also available. The returned URL follows https://<slug>.share.rungrain.com.
  9. Iterate at the same destination. Readers leave comments on the artifact. The agent reads them, updates the workspace, and repeats push and checkpoint. The audience returns to the artifact instead of chasing another localhost capture.

What it costs

The free tier includes the Mac app, CLI, unlimited published artifacts, ten sandboxes that sleep when idle, one always-on workspace and a self-hostable core. It requires no card. You bring the coding agent and model plan you already have, and Grain does not sell or mark up those tokens. Pro is $65 per user per month for more always-on workspaces, team seats, shared spaces and custom domains. Enterprise is available by contact for a deployment in the customer's cloud with SSO, audit, policy controls and direct support. Published artifacts stay published if you stop paying, and every artifact remains files you can export.

Limits

  • Grain is not a coding agent. Claude Code, Codex, Cursor or another CLI agent creates the page or application.
  • Grain is not an IDE. Continue using your editor for human code changes and repository work.
  • A published artifact is not automatically a production service. Move to a general deploy platform when the app needs its own CI, operational policy and infrastructure lifecycle.
  • Public links can be opened by anyone who has them. Select password protection or invited access for private content.
  • Custom domains require Pro and a CNAME. Free artifacts use the provided share.rungrain.com address.
  • The desktop product is Mac first. Windows is on a waitlist, though the self-hostable core runs on Linux.

Frequently asked questions

How do I turn localhost into a public URL?

Initialize the project as a Grain workspace, push its files, create a checkpoint and run the public share command. The CLI returns a URL on share.rungrain.com.

Does the URL work after I close my laptop?

Yes. Published artifacts stay published after the laptop closes and the coding session ends.

Can the published app keep data?

Yes. A full app can use a Postgres database and can include logins and scheduled jobs. A static artifact can remain files only.

Do I have to make the localhost app public?

No. Grain supports public links, password-protected links and access for invited people only.

Can my coding agent update the same URL?

Yes. The agent can revise workspace files, then you push and checkpoint the new state. Readers can comment on the artifact, and the agent can act on that feedback.

Replace localhost with a place people can return to

Download the free Mac app and publish the next useful thing your coding agent builds.

Free forever. No card. Bring your own agent.

Sources · facts verified 2026-09-04