Claude Code + xCloud

Run Docker apps with Claude Code on xCloud

Running Docker apps with Claude Code means asking Anthropic's terminal agent to scan the Dockerfile or Compose file in your working directory, deploy it to an xCloud Docker server after one approval, take a backup before you change it and diagnose the deploy if it fails.

  • Skill: xcloud:deploy
  • Toolsets: sites, servers
  • Free with every xCloud account

YouDeploy this repo to the Frankfurt Docker server as a Compose app. Dry run first.

git_compose-scanread-only

Agentdocker-compose.yml has two services, web and db. Only web publishes a port: 8080. I would proxy to 127.0.0.1:8080. Sending the dry run.

servers_sites_git_dockerdry run

AgentDry run resolved: compose file docker-compose.yml, port 8080, no warnings. Create the site on Frankfurt?

YouYes.

servers_sites_git_dockerneeds approval

AgentCreated with the same body and an idempotency key. Provisioning has started on Frankfurt; I am polling the site status and will fetch the URL once it is live.

. Keep a human in the loop: xCloud stops and asks before anything that creates, deploys, updates, reboots, deletes or buys.

Setup

How Do You Set Up Claude Code to Run Docker apps on xCloud?

Connect Claude Code once; every job on this account uses the same connection. Then ask in plain words.

  1. Add the xCloud MCP server

    Run this in your terminal, then type /mcp inside Claude Code, pick xcloud and choose Authenticate. The browser opens on the xCloud approval screen, where you tick the teams and choose Read-only or Full access.

    Terminal
    claude mcp add xcloud --transport http https://app.xcloud.host/mcp
  2. Install the xCloud skills plugin

    Optional but recommended. Inside Claude Code, add the xCloud marketplace, install the plugin and reload. The nine skills teach Claude Code which tool to reach for, how to dry-run and confirm, how to poll a long job and how to diagnose a failed deploy.

    Terminal
    /plugin marketplace add xCloudDev/xcloud-agent-skills
    /plugin install xcloud@xcloud-agent-skills
    /reload-plugins
  3. No browser? Use an API key

    For a headless or CI machine, create a token with the mcp:invoke scope plus the read abilities for the areas it will use (read:servers and read:sites, with read:billing and read:addons for billing and add-on tools) and the matching write: abilities if it should change things in Settings, Developers, API Tokens and pass it as a header. Keep the single quotes: xCloud tokens contain a pipe character.

    Terminal
    claude mcp add xcloud --transport http https://app.xcloud.host/mcp \
      --header 'Authorization: Bearer YOUR_TOKEN'
  4. Check it worked

    Then ask Claude Code for the job itself, for example:

    Prompt
    Scan the compose file on main and tell me which port xCloud would proxy to.

In practice

How Does Docker apps Work from Claude Code?

Claude Code starts in your project directory, so the Compose file is already in front of it. Before it calls xCloud it can open docker-compose.yml itself, see which services publish which ports, and then run git_compose-scan to compare its own reading with what xCloud resolves for the pushed branch. That cross-check matters more for Docker apps than for a Node.js deploy, because xCloud runs your Compose file as it is and proxies to a host port the file must publish. If the file binds port 80, publishes nothing or pulls a private image, Claude Code tells you before any site exists. Because it can edit files, it can also propose the fix in the same session: change the mapping to 127.0.0.1:8080:8080, point the service at a build context instead of a private image, commit and push.

The exchange in the terminal stays short. You name the Docker server, Claude Code runs git_detect and git_compose-scan, and prints the services, the published ports and the primary port it suggests. It then sends the Docker create request as a dry run and shows the resolved configuration: the Compose file name, the port, the address and any warnings. You answer yes once. It sends the same body with confirm set to true and an idempotency key, polls the site status and fetches the URL before it calls the app live. A 502 at that point is the cue to re-read the Compose file for a missing ports entry, which Claude Code can do without leaving the terminal.

Day-two work happens in the same session. With the xCloud skills plugin installed, the xcloud:deploy skill adds the judgement: it asks for sites_docker_backup before you bump an image tag, reads the backup list and settings with sites_docker_backups and sites_docker_backupSettings, and on a failed deploy goes straight to sites_deploy-diagnosis, shows you the fields that can be corrected and retries on the same site so the domain and port survive. Restoring a backup stays a dashboard step, and Claude Code gives you the path instead of trying it.

Claude Code specific: xCloud scans and deploys what is on the remote branch, not what is in your working tree. If Claude Code edited docker-compose.yml a minute ago, commit and push before it runs git_compose-scan, or the scan reports the old ports and the dry run describes a configuration you have already changed. A Docker backup also stops the app while it captures, so ask for one at a quiet hour rather than in the middle of a release.

What xCloud does for docker apps

xCloud reads the repository, scans the Compose file for services and ports before anything is created, previews the site with a dry run and deploys it behind its own nginx once you approve. Docker sites can be backed up on demand and on a schedule, and a failed deploy is diagnosed and retried on the same site.

  1. Pick a Docker server. The agent uses the server you name, or lists your servers and asks. A Docker deploy needs a Docker server; any other stack answers with an incompatible_server refusal, and an agentic server never takes a second site. WordPress is not supported on Docker servers.
  2. Detect the repository. git_detect reads the repository root for a Dockerfile or one of the four Compose file names, and checks access and server compatibility. It creates nothing, and an access problem is never worked around by naming an app type by hand.
  3. Scan the Compose file. git_compose-scan runs before the dry run. It lists the services and the host ports the file publishes, resolves which Compose file name it found, and suggests a primary port. The agent never guesses the port.
  4. Dry run, then one approval. The agent sends the Docker create request with dry_run set to true and shows the resolved configuration: compose file, port, address and warnings. It asks once, naming the server and the URL, before sending the same body with confirm set to true and an idempotency key.
  5. Poll and verify. A 202 means queued, not running. The agent polls the site status until it is terminal, reads failed_steps and the SSL block, and fetches the URL before it calls the app live. A 502 here usually means the Compose file publishes no port.
  6. Back up and recover. The agent can take a Docker backup, read the backup list and settings, and add a note to a backup. If a deploy fails it reads the diagnosis, proposes a fix from the correctable fields and retries on the same site after your approval. Restoring a backup is a dashboard step.

Reference

Docker apps Settings and Limits on xCloud

The facts Claude Code works within when it runs Docker apps. Where a row names the dashboard, that step stays yours to take there.

Setting or limitWhat applies
Supported inputsA Dockerfile for a single container, or a Compose file for one or more services, on a Docker server. Go, Python, Rust and Java apps all deploy this way
Server stackDocker servers only. The Docker deploy on any other stack, including an agentic server, answers 422 with the code incompatible_server
Which Compose file runsdocker-compose.yml at the repository root. A file named compose.yaml, compose.yml or docker-compose.yaml, or one in a subdirectory, deploys through the pinned Docker create with docker.compose_file set to the path the scan resolved
Public portxCloud's nginx owns ports 80 and 443 and proxies to one host port of 1024 or higher on 127.0.0.1. xCloud runs your Compose file as-is and never rewrites its ports mapping
Port refusalsA port another site already holds is refused as port_unavailable. A port the file does not publish is refused as port_not_published, with the published ports listed
No published portA Compose file that publishes no port is accepted and then answers 502, so the scan is the step that catches it
Private registriesThe deploy runs docker compose pull and never docker login, so an image from a private registry cannot be pulled. Build the image from source instead
Environment and redeploysSend environment values through env_file_content. A redeploy runs git reset --hard and git clean -df in the site directory, so uncommitted server-side changes are lost
What a Docker backup holdsNamed volumes, eligible bind mounts, the Compose file and the app's .env, in an encrypted snapshot. The app is stopped while the backup captures and restarted afterwards
Backup toolsTake a backup, list backups, read the count and the settings, change the settings, add a note and delete a backup. Remote copies go to a storage provider you add in the dashboard
RestoresA restore replaces the app's data in place, so it stays a dashboard step: Site, Site Backup, Previous Backups, Restore Backup
Dot-prefixed pathsA 403 on a path that starts with a dot is the dot-path allowlist. It is fixed with docker.allowed_dot_paths in the deploy settings, without a rebuild

Rules Claude Code has to follow

  • The Compose file is scanned before the dry run, and the port always comes from the scan, never from a guess.
  • A file that binds ports 80 or 443, publishes no port or pulls from a private registry is not deployed as-is. The agent shows the rewrite, such as publishing 127.0.0.1:<high port>:<app port> and building the image from source, and the change goes into your repository.
  • Creating a site, deploying, redeploying and deleting a backup stop for your approval. A backup runs without a separate prompt but stops the app while it captures, so ask for one at a quiet time.
  • A failed Docker site is retried in place with corrections. It is never deleted and recreated, because it keeps its domain and port.
  • Restoring a backup, adding a backup storage provider and changing a live site's domain are dashboard steps; the agent gives you the path and the dashboard link xCloud returned.

Example prompts

What Can You Ask Claude Code to Do for Docker apps?

Type these as written and swap in your own repository, site and server names. Reads and routine actions such as backups, cache purges, PageSpeed scans and vulnerability scans run straight away; creating, deploying, updating, rebooting, deleting, buying or starting a broken-link scan stops and asks first.

Prompt
Scan the compose file on main and tell me which port xCloud would proxy to.
Prompt
Deploy this repo to the Frankfurt Docker server as a Compose app. Dry run first, then wait for me.
Prompt
Back up notes.example.com, then bump the image tag in docker-compose.yml and redeploy.
Prompt
Scan the docker-compose.yml in github.com/acme/api and tell me which services and ports xCloud would use.
Prompt
Deploy github.com/acme/shop to the Frankfurt Docker server as a Compose app. Scan the compose file first, show me the services and ports, then wait for my approval before creating anything.
Prompt
Deploy the main branch of github.com/acme/api to my Docker server as a Compose app on a staging hostname.
Prompt
My Compose app on notes.example.com answers 502. Check which port its compose file publishes and which port xCloud is using.
Prompt
Take a backup of the Docker app on notes.example.com now, before I upgrade it, and tell me when it is done.
Prompt
Show the backup settings and the last backup of every Docker app on this team, and list the ones with no schedule.
Prompt
The last deploy of the API site failed. Diagnose it, show me the settings I can correct, fix the build command and retry on the same site.

Claude Code and Docker apps: Frequently Asked Questions

What people ask before they let Claude Code run Docker apps through xCloud.

Can Claude Code fix my Compose file before xCloud deploys it?

Yes, in your repository. When the scan shows a file that binds port 80, publishes no port or pulls a private image, Claude Code can edit docker-compose.yml, commit and push, then scan again. xCloud itself never rewrites your ports mapping.

Does Claude Code need the Docker CLI on my machine to run a Docker app on xCloud?

No. The scan, the dry run and the deploy all run on xCloud's side against your repository. Claude Code only needs the xCloud MCP connection and a Docker server on your account.

Which servers can run a Docker app on xCloud?

Docker servers. Node.js, PHP and static builds use Nginx or OpenLiteSpeed servers, and the Docker deploy on any other stack is refused with an incompatible_server code. An OpenClaw, Hermes, Paperclip or DeepSeek Harness server hosts only the site created at provisioning, so it takes no Docker app.

Why does the agent scan the Compose file before deploying?

xCloud proxies to the host port your file publishes and never rewrites it. The scan lists the services and ports, so the agent picks a port that is free on the server and published by the file instead of guessing.

Why does my Compose app answer 502 after it deployed?

The most common cause is a Compose file that publishes no port: xCloud accepts it, then its nginx has nothing to proxy to. Publish the app on 127.0.0.1 with a high port, such as 127.0.0.1:8080:8080, and redeploy.

Can an agent deploy an image from a private registry?

Not as-is. The deploy runs docker compose pull and never docker login, so a private image cannot be pulled. Build the image from source in the Compose file, or deploy a repository that does.

Can an agent back up and restore a Docker app?

It can take a backup, read the backup list and settings, change the settings, add a note and delete a backup. Restoring replaces the app's data in place, so you do that in the dashboard under Site, Site Backup, Previous Backups.

Can I run WordPress as a Docker app on xCloud?

No. Creating a WordPress site on a Docker server is refused because WordPress is not supported on Docker servers. Use an Nginx or OpenLiteSpeed server for WordPress.

Other agents

Docker apps with Other Agents

The same job, the same xCloud tools, a guide for each client.

Run Your Hosting from Claude Code

xCloud MCP, the Agent Skills and the Public API are free with every account. Connect once and ask.