Answer: You can set up a self-hosted environment and runner either with the guided setup, run by executing `claude self-hosted-runner setup` in your shell, or with manual steps: create the environment on claude.ai, write the environment secret to a file, and start the runner with `--environment-secret-file` and `--base-dir`. Status: Confirmed Entry: tool/claude-code/admin-and-enterprise/set-up-environment-and-runner Revision: 2 Digest: sha256:388af2ec5e44d47c (changes whenever the content changes) Timeline: Created: 2026-11-13T03:05:41Z Last changed: 2026-11-18T12:20:03Z (runner start command: — → claude self-hosted-runner --environment-secret-file '/etc/claude/environment-secret' --base-dir '') Last verified: 2026-11-20T12:25:00Z Next check: 2026-11-21T12:25:00Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Unit | Source | As of guided setup command | claude self-hosted-runner setup | | [1] | 2026-11-20 runner start command | claude self-hosted-runner --environment-secret-file '/etc/claude/environment-secret' --base-dir '' | | [1] | 2026-11-20 secret directory command | mkdir -p /etc/claude | | [1] | 2026-11-20 secret file write command | (umask 077 && cat > /etc/claude/environment-secret) | | [1] | 2026-11-20 secret expiry | 365 days after creation | days | [1] | 2026-11-20 minimum version for guided setup | 2.1.224 | | [1] | 2026-11-20 default base directory | /workspace | | [1] | 2026-11-20 Sources: [1] Anthropic. "Self-hosted environments quickstart". https://code.claude.com/docs/en/self-hosted-environments-quickstart.md Role: primary. Accessed: 2026-11-20T12:25:00Z Quote: "claude self-hosted-runner setup" (Supports: guided setup command) Quote: "claude self-hosted-runner --environment-secret-file '/etc/claude/environment-secret' --base-dir ''" (Supports: runner start command) Quote: "mkdir -p /etc/claude" (Supports: secret directory command) Quote: "(umask 077 && cat > /etc/claude/environment-secret)" (Supports: secret file write command) Quote: "it expires 365 days after creation" (Supports: secret expiry) Quote: "On versions older than 2.1.224, the setup command starts a Claude session with the words as the prompt instead of the guided setup." (Supports: minimum version for guided setup) Quote: "Without `--base-dir` it uses `/workspace`" (Supports: default base directory) Published: 2026-11-20T03:48:50Z Snapshot SHA-256: 2717fc8f051dd4b696269be1fd95b945b87685cadc0d8f4386c16eba9531e806 (captured 2026-11-17T12:30:53Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-17T12:30:54Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:25:00Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:25:00Z Last attempt: 2026-11-20T12:25:00Z Notes and limitations: Extracted automatically from a single official source (section "Set up an environment and runner"). Related: https://latestn.com/tool/claude-code/admin-and-enterprise/size-postgres-connection-pool How do I size the Postgres connection pool for a Claude apps gateway? https://latestn.com/tool/claude-code/admin-and-enterprise/stop-user-installed-mods How do I stop user-installed mods from loading in Claude Code for my organization? https://latestn.com/tool/claude-code/admin-and-enterprise/strict-mode-plugin-entries What does strict mode do for plugin entries in a Claude Code marketplace? https://latestn.com/tool/claude-code/admin-and-enterprise/set-spend-cap-admin-api How do I set a spend limit for a developer through the Claude apps gateway Admin API? https://latestn.com/tool/claude-code/admin-and-enterprise/set-team-spend-limits How do I set spend limits for my team in Claude Code? https://latestn.com/tool/claude-code/admin-and-enterprise/set-up-claude-tag-for-team How do I set up Claude Tag for my whole team as an administrator? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-18T12:20:03Z | changed | runner start command: — → claude self-hosted-runner --environment-secret-file '/etc/claude/environment-secret' --base-dir '' | [1] 2026-11-18T12:20:03Z | changed | manual runner command: claude self-hosted-runner --environment-secret-file '/etc/claude/environment-secret' --base-dir '' → — | [1] 2026-11-13T03:05:41Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/admin-and-enterprise/set-up-environment-and-runner/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/admin-and-enterprise/set-up-environment-and-runner POST: https://latestn.com/dispute/tool/claude-code/admin-and-enterprise/set-up-environment-and-runner with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/admin-and-enterprise/set-up-environment-and-runner?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I set up a self-hosted environment and runner in Claude Code? Revision 2, last verified 2026-11-20T12:25:00Z. https://latestn.com/tool/claude-code/admin-and-enterprise/set-up-environment-and-runner (accessed 2026-11-21T10:02:01Z). @misc{LatestN_tool_claude_code_admin_and_enterprise_set_up_environment_and_runner_r2, title = {How do I set up a self-hosted environment and runner in Claude Code?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/admin-and-enterprise/set-up-environment-and-runner}}, note = {Revision 2; digest sha256:388af2ec5e44d47c; last verified 2026-11-20T12:25:00Z; accessed 2026-11-21T10:02:01Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/admin-and-enterprise/set-up-environment-and-runner