# Install CloudFrost Dev Agent

### Quick Setup

You can quickly install or update the Dev Space Agent using this command below.

```
docker run -d \
    -p 5555:5555 \
    --name cloudfrost-agent \
    --pull always \
    --restart on-failure:3 \
    -v cloudfrost_agent:/app/Data \
    -v /var/run/docker.sock:/var/run/docker.sock:ro \
    -v /var/lib/docker/volumes/portainer_data/_data/compose:/var/lib/docker/volumes/portainer_data/_data/compose:ro \
    -v /var/lib/docker/volumes/portainer_data/_data/custom_templates:/var/lib/docker/volumes/portainer_data/_data/custom_templates:ro \
    ghcr.io/fluxpointdev/cloudfrost-dev/agent:latest
```

You can get the agent key using this command\
`cat /var/lib/docker/volumes/cloudfrost_agent/_data/Config.json`

Or if you want a more custom compose setup you can use the `docker-compose.yml` config here.

<details>

<summary>Compose Setup</summary>

1. Open a terminal.
2. Create a folder for the agent config `mkdir cloudfrost_agent`
3. Navigate to the folder using `cd cloudfrost_agent`
4. <mark style="color:yellow;">Upload</mark> the config below in the folder as `docker-compose.yml`
5. Start the agent using `docker compose up -d`&#x20;

To update the agent you can

1. Run `docker compose down` to stop the agent.
2. Run `docker compose pull` to get the latest version
3. Run `docker compose up -d` to start the agent.

```yaml
services:
  cloudfrost-agent:
    container_name: cloudfrost-agent
    image: ghcr.io/fluxpointdev/cloudfrost-dev/agent:latest
    volumes:
      - cloudfrost-agent_data:/app/Data:rw
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /var/lib/docker/volumes/portainer_data/_data/compose:/var/lib/docker/volumes/portainer_data/_data/compose:ro
      - /var/lib/docker/volumes/portainer_data/_data/custom_templates:/var/lib/docker/volumes/portainer_data/_data/custom_templates:ro
    working_dir: /app
    restart: on-failure:3
    networks:
      - cloudfrost-agent_network
    ports:
      - 5555:5555
    dns:
      - 1.1.1.2
      - 1.0.0.2
networks:
  cloudfrost-agent_network:
    name: cloudfrost-agent_network
    driver: bridge
```

</details>

### Website Agent Setup

You can now setup and manage your server on the Dev Space Website by creating a team, going to Servers, click Create Server and then go through the setup page with your server IP and agent key then name the server anything you want.

<div align="center"><figure><img src="https://476319768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTk02nT1MG8myAiyOi9h9%2Fuploads%2FBuFT13YyKU15LUQ6P50r%2Fimage.png?alt=media&#x26;token=e181ece0-400e-4718-a398-9b5f9fc31928" alt="" width="256"><figcaption></figcaption></figure></div>

<div align="center"><figure><img src="https://476319768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTk02nT1MG8myAiyOi9h9%2Fuploads%2FtN1W9dsXUlbOj2dWVLIp%2Fimage.png?alt=media&#x26;token=7e4af507-92bf-4627-9ed1-8a612eca2891" alt="" width="375"><figcaption></figcaption></figure></div>
