# Running Buildkite Agent with Docker

You can run the Buildkite Agent inside a Docker container using the official Docker images.

<div class="Docs__note">
<p class="Docs__note__heading">Running each build in it’s own container</p>
<p>These instructions cover how to run the agent using Docker. If you want to learn how to isolate each build using Docker and any of our standard Linux-based installers read the <a href="/docs/builds/docker-containerized-builds">Docker-Based Builds</a> guide.</p>
</div>

<%= toc %>

## Running via Docker

<%= render_agent_setup :docker %>

## Running on startup

By default Docker [starts containers on restart](https://docs.docker.com/articles/host_integration/) so there's no need for upstart or similar. Simply start your container with `-d` to daemonize it and it will be restarted on system boot with the same environment variables and arguments.

## Configuration and Customization

See the [GitHub repository](https://github.com/buildkite/docker-buildkite-agent) for instructions on how to customize the base image. Alternatively you can create your own Docker image using our standard installer packages (see our [Ubuntu Dockerfile](https://github.com/buildkite/docker-buildkite-agent/blob/master/ubuntu/Dockerfile) for an example).

# Running Buildkite Agent with Docker

You can run the Buildkite Agent inside a Docker container using the official Docker images.

<div class="Docs__note">
<p class="Docs__note__heading">Running each build in it’s own container</p>
<p>These instructions cover how to run the agent using Docker. If you want to learn how to isolate each build using Docker and any of our standard Linux-based installers read the <a href="/docs/builds/docker-containerized-builds">Docker-Based Builds</a> guide.</p>
</div>

<%= toc %>

## Running via Docker

<%= render_agent_setup :docker %>

## Running on startup

By default Docker [starts containers on restart](https://docs.docker.com/articles/host_integration/) so there's no need for upstart or similar. Simply start your container with `-d` to daemonize it and it will be restarted on system boot with the same environment variables and arguments.

## SSH Keys, Configuration and Customization

See the [GitHub repository](https://github.com/buildkite/docker-buildkite-agent) for instructions on how to customize the base image. Alternatively you can create your own Docker image using our standard installer packages (see our [Ubuntu Dockerfile](https://github.com/buildkite/docker-buildkite-agent/blob/master/ubuntu/Dockerfile) for an example).

Add the word 'SSH Keys' to Docker docs so it catches more eyeballs
Add the word 'SSH Keys' to Docker docs so it catches more eyeballs
