> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ardor.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker Image

> Deploy containerized applications from Docker Hub instantly. No build required — just specify an image and Ardor handles the rest.

## Overview

Deploy any public Docker image directly to Ardor without writing code or Dockerfiles. This is the fastest way to get a service running — perfect for databases, caches, proxies, and pre-built applications.

<Tip>
  **Cerebrum can do this for you.** Just say "add a PostgreSQL database" or "deploy Redis" — Cerebrum will create and configure the service. The steps below are for when you want to do it manually.
</Tip>

<Note>
  **New to Docker?** Docker images are pre-packaged applications ready to run. Think of them as "app installers" that include everything needed — code, runtime, libraries, and configuration.
</Note>

## Why Use Docker Images

<CardGroup cols="2">
  <Card title="Zero build time" icon="bolt">
    Skip the build process entirely. Images are pulled and deployed in seconds.
  </Card>

  <Card title="Battle-tested software" icon="shield-check">
    Use official images maintained by software vendors — PostgreSQL, Redis, Nginx, and thousands more.
  </Card>

  <Card title="Version control" icon="code-branch">
    Pin specific versions with tags. Roll back instantly by changing the tag.
  </Card>

  <Card title="No code required" icon="wand-magic-sparkles">
    Deploy infrastructure services without writing a single line of code.
  </Card>
</CardGroup>

<Tip>
  **Best for:** Databases, caches, message queues, reverse proxies, and any pre-built application available on Docker Hub.
</Tip>

## Before You Start

<Warning>
  **Know your image name!** There's no Docker Hub search yet — you'll need to type the exact image name and tag. Good news: images from your previous deployments are cached, so you can quickly find and reuse them.
</Warning>

<AccordionGroup>
  <Accordion title="Public images only">
    Currently, Ardor supports public Docker images from Docker Hub. Private registries are coming soon.
  </Accordion>

  <Accordion title="Ports are detected automatically">
    Ardor reads port configuration directly from the image metadata. You typically don't need to change this unless you have specific requirements.
  </Accordion>

  <Accordion title="Some variables require manual setup">
    Ardor extracts environment variables defined in the image automatically. However, some images require additional variables (like passwords) that must be set manually. Check the image documentation for required variables.

    <img src="https://mintcdn.com/ardor/sf-RwXk0pWSNetwj/docs/services/create_service/images/docker/step-5-vars.jpg?fit=max&auto=format&n=sf-RwXk0pWSNetwj&q=85&s=611f629fa9a884775a6e669b93499442" alt="Environment variables extracted from image" width="875" height="989" data-path="docs/services/create_service/images/docker/step-5-vars.jpg" />
  </Accordion>
</AccordionGroup>

## How to create

<Tabs>
  <Tab title="1. Add Service">
    <img src="https://mintcdn.com/ardor/sf-RwXk0pWSNetwj/docs/services/create_service/images/docker/step-1-add.jpg?fit=max&auto=format&n=sf-RwXk0pWSNetwj&q=85&s=1d3c6d282aada22e3b52880e08077168" alt="Step 1" width="414" height="367" data-path="docs/services/create_service/images/docker/step-1-add.jpg" />

    Click **Add Service** → select **Docker Image**
  </Tab>

  <Tab title="2. Enter Image">
    <img src="https://mintcdn.com/ardor/sf-RwXk0pWSNetwj/docs/services/create_service/images/docker/step-2-input.jpg?fit=max&auto=format&n=sf-RwXk0pWSNetwj&q=85&s=b0b2a3ce318bacd288de257baf2c0685" alt="Step 2" width="394" height="302" data-path="docs/services/create_service/images/docker/step-2-input.jpg" />

    Type the image name (e.g., `nginx:latest`, `postgres:16`)

    <img src="https://mintcdn.com/ardor/sf-RwXk0pWSNetwj/docs/services/create_service/images/docker/step-2-tip.jpg?fit=max&auto=format&n=sf-RwXk0pWSNetwj&q=85&s=91a2b6a0f504aaa4cf8cbb840e3d7c07" alt="Tip" width="407" height="251" data-path="docs/services/create_service/images/docker/step-2-tip.jpg" />

    Ardor suggests cached images as you type
  </Tab>

  <Tab title="3. Initializing">
    <img src="https://mintcdn.com/ardor/sf-RwXk0pWSNetwj/docs/services/create_service/images/docker/step-3-pulling.jpg?fit=max&auto=format&n=sf-RwXk0pWSNetwj&q=85&s=f4969d97d645b2cc9b871cd1fbd05b76" alt="Step 3" width="591" height="370" data-path="docs/services/create_service/images/docker/step-3-pulling.jpg" />

    Ardor pulls the image and extracts environment variables — may take a moment for new images
  </Tab>

  <Tab title="4. Ready">
    <img src="https://mintcdn.com/ardor/sf-RwXk0pWSNetwj/docs/services/create_service/images/docker/step-4-ready.jpg?fit=max&auto=format&n=sf-RwXk0pWSNetwj&q=85&s=1fa3978018dbf18f5421c42ab200e676" alt="Step 4" width="607" height="415" data-path="docs/services/create_service/images/docker/step-4-ready.jpg" />

    Image pulled and configured — ready to deploy!
  </Tab>
</Tabs>

<Note>
  Some images need extra setup (like `POSTGRES_PASSWORD` for databases). Check [Common Docker Images](#common-docker-images) below for specific requirements.
</Note>

## Image Name Format

Docker images follow this naming convention:

```
[registry/]repository:tag
```

| Format           | Example                 | Description                                     |
| ---------------- | ----------------------- | ----------------------------------------------- |
| `image:tag`      | `nginx:1.25`            | Official image with specific version            |
| `image:latest`   | `redis:latest`          | Latest version (not recommended for production) |
| `image:variant`  | `node:20-alpine`        | Variant builds (alpine = smaller size)          |
| `user/image:tag` | `bitnami/postgresql:16` | Community/vendor image                          |

<Note>
  **Cached Images:** When you type an image name, Ardor suggests previously deployed images from the cache. Don't see your image? You'll be the first to add it — and you'll help the whole community! The cache is shared, so every new image makes Ardor smarter for everyone.
</Note>

<Warning>
  Avoid using `:latest` in production. Pin specific versions like `postgres:16.2` to ensure consistent deployments.
</Warning>

## Common Docker Images

Here are popular images and their typical configurations:

<Tabs>
  <Tab title="PostgreSQL">
    **Image:** `postgres:16`

    **Port:** `5432` (auto-detected)

    **Manual Variables Required:**

    | Variable            | Description                  | Example            |
    | ------------------- | ---------------------------- | ------------------ |
    | `POSTGRES_PASSWORD` | Database password (required) | `mysecretpassword` |
    | `POSTGRES_USER`     | Username (optional)          | `myuser`           |
    | `POSTGRES_DB`       | Database name (optional)     | `myapp`            |

    <Warning>
      PostgreSQL will not start without `POSTGRES_PASSWORD`. Add it as a secret before deploying.
    </Warning>

    **Recommended Resources:** 0.5 CPU, 1GB RAM, 10GB Storage
  </Tab>

  <Tab title="Redis">
    **Image:** `redis:7-alpine`

    **Port:** `6379` (auto-detected)

    **Optional Variables:**

    | Variable         | Description           | Example            |
    | ---------------- | --------------------- | ------------------ |
    | `REDIS_PASSWORD` | Enable authentication | `mysecretpassword` |

    **Recommended Resources:** 0.25 CPU, 512MB RAM

    <Note>
      Redis works without any manual configuration. Use `-alpine` variants for smaller image size.
    </Note>
  </Tab>

  <Tab title="MongoDB">
    **Image:** `mongo:7`

    **Port:** `27017` (auto-detected)

    **Optional Variables:**

    | Variable                     | Description    | Example            |
    | ---------------------------- | -------------- | ------------------ |
    | `MONGO_INITDB_ROOT_USERNAME` | Admin username | `admin`            |
    | `MONGO_INITDB_ROOT_PASSWORD` | Admin password | `mysecretpassword` |

    **Recommended Resources:** 0.5 CPU, 1GB RAM, 10GB Storage
  </Tab>

  <Tab title="Nginx">
    **Image:** `nginx:1.25-alpine`

    **Port:** `80` (auto-detected)

    **Recommended Resources:** 0.1 CPU, 128MB RAM

    <Note>
      Nginx works out of the box with no manual configuration. For custom config, consider using an Empty Service with your own Dockerfile.
    </Note>
  </Tab>
</Tabs>

## Automatic Port Detection

Ardor automatically reads the exposed port from the Docker image metadata. In most cases, you don't need to configure the port manually.

<Note>
  Only override the auto-detected port if you have specific requirements and know exactly what port the image expects.
</Note>

## Updating Images

To update to a new image version:

1. Open the service settings
2. Change the image tag (e.g., `postgres:16.1` → `postgres:16.2`)
3. Click **Deploy**

Ardor pulls the new image and replaces the running container.

<Warning>
  For databases, always back up your data before updating to a new major version.
</Warning>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Image pull failed">
    **Cause:** Image name or tag doesn't exist on Docker Hub.

    **Solution:**

    * Verify the image name on [Docker Hub](https://hub.docker.com)
    * Check for typos in the image name or tag
    * Ensure the image is public (private registries not yet supported)
  </Accordion>

  <Accordion title="Container keeps restarting">
    **Cause:** Missing required environment variables or incorrect configuration.

    **Solution:**

    * Check the image documentation for required variables
    * Review **Runtime Logs** for error messages
    * Ensure the configured port matches what the image expects
  </Accordion>

  <Accordion title="Cannot connect to service">
    **Cause:** Service not ready or network misconfiguration.

    **Solution:**

    * Wait for the service to finish initializing (check logs)
    * For private services, ensure you're connecting from within the solution network
    * Ports are auto-detected — if you changed the port manually, verify it matches the image's actual exposed port
  </Accordion>

  <Accordion title="Data lost after restart">
    **Cause:** Persistent storage not enabled.

    **Solution:**

    * Enable storage in the service resource configuration
    * Set appropriate storage size for your data needs
    * Redeploy the service
  </Accordion>

  <Accordion title="Out of memory errors">
    **Cause:** Insufficient RAM allocated for the image.

    **Solution:**

    * Increase RAM allocation in resource settings
    * Consider using lighter image variants (e.g., `-alpine`)
    * Check if the image has memory configuration options
  </Accordion>
</AccordionGroup>

## What's Next

<CardGroup cols="2">
  <Card title="Configure Resources" icon="sliders" href="/docs/services/service#resource-configuration">
    Fine-tune CPU, RAM, and storage for optimal performance
  </Card>

  <Card title="Add Environment Variables" icon="key" href="/docs/services/service#variables-and-secrets">
    Configure your service with variables and secrets
  </Card>

  <Card title="Networking" icon="network-wired" href="/docs/services/networking">
    Configure ports and public/private access
  </Card>

  <Card title="Monitor Logs" icon="scroll" href="/docs/services/service#logging">
    Debug issues using build and runtime logs
  </Card>
</CardGroup>
