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.
Grain / Learn / From localhost to a URL your agent can keep
Switching guide
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.
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.
localhost points to the viewer's own machine. Sending it to a teammate cannot route them to the developer's process.grain login. This establishes the local CLI session before you connect the project folder to a workspace.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.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.grain push. This publishes the workspace contents. Static pages can remain simple artifacts; full apps can include Postgres, logins and scheduled jobs.grain checkpoint -m "inventory tool ready for review". The message identifies why this state exists and gives later changes a clear baseline.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.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.
share.rungrain.com address.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.
Yes. Published artifacts stay published after the laptop closes and the coding session ends.
Yes. A full app can use a Postgres database and can include logins and scheduled jobs. A static artifact can remain files only.
No. Grain supports public links, password-protected links and access for invited people only.
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.
Download the free Mac app and publish the next useful thing your coding agent builds.
Free forever. No card. Bring your own agent.