File size: 5,042 Bytes
3382f47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# AutoGPT + Docker guide

!!! important
    Docker Compose version 1.29.0 or later is required to use version 3.9 of the Compose file format.
    You can check the version of Docker Compose installed on your system by running the following command:

    ```shell
    docker compose version
    ```

    This will display the version of Docker Compose that is currently installed on your system.

    If you need to upgrade Docker Compose to a newer version, you can follow the installation instructions in the Docker documentation: https://docs.docker.com/compose/install/

## Basic Setup

1. Make sure you have Docker installed, see [requirements](./index.md#requirements)
2. Create a project directory for AutoGPT

    ```shell
    mkdir AutoGPT
    cd AutoGPT
    ```

3. In the project directory, create a file called `docker-compose.yml`:

    <details>
    <summary>
      <code>docker-compose.yml></code> for <= v0.4.7
    </summary>

    ```yaml
    version: "3.9"
    services:
      auto-gpt:
        image: significantgravitas/auto-gpt
        env_file:
          - .env
        profiles: ["exclude-from-up"]
        volumes:
          - ./auto_gpt_workspace:/app/auto_gpt_workspace
          - ./data:/app/data
          ## allow auto-gpt to write logs to disk
          - ./logs:/app/logs
          ## uncomment following lines if you want to make use of these files
          ## you must have them existing in the same folder as this docker-compose.yml
          #- type: bind
          #  source: ./azure.yaml
          #  target: /app/azure.yaml
    ```
    </details>

    <details>
    <summary>
      <code>docker-compose.yml></code> for > v0.4.7 (including <code>master</code>)
    </summary>

    ```yaml
    version: "3.9"
    services:
      auto-gpt:
        image: significantgravitas/auto-gpt
        env_file:
          - .env
        ports:
          - "8000:8000"  # remove this if you just want to run a single agent in TTY mode
        profiles: ["exclude-from-up"]
        volumes:
          - ./data:/app/data
          ## allow auto-gpt to write logs to disk
          - ./logs:/app/logs
          ## uncomment following lines if you want to make use of these files
          ## you must have them existing in the same folder as this docker-compose.yml
          ## component configuration file
          #- type: bind
          #  source: ./config.json
          #  target: /app/config.json
    ```
    </details>


1. Download [`.env.template`][.env.template] and save it as `.env` in the AutoGPT folder.
2. Follow the standard [configuration instructions](./index.md#completing-the-setup),
   from step 3 onwards and excluding `poetry install` steps.
3. Pull the latest image from [Docker Hub]

    ```shell
    docker pull significantgravitas/auto-gpt
    ```
4. _Optional: mount configuration file._
      If you have component configuration file, for example `config.json`, place it in `classic/original_autogpt/data/` directory. Or place it in `classic/original_autogpt/` and uncomment the line in `docker-compose.yml` that mounts it.
      To learn more about configuring, see [Component configuration](../../forge/components/components.md#json-configuration)

!!! note "Docker only supports headless browsing"
    AutoGPT uses a browser in headless mode by default: `HEADLESS_BROWSER=True`.
    Please do not change this setting in combination with Docker, or AutoGPT will crash.

[.env.template]: https://github.com/Significant-Gravitas/AutoGPT/tree/master/classic/original_autogpt/.env.template
[Docker Hub]: https://hub.docker.com/r/significantgravitas/auto-gpt

## Developer Setup

!!! tip
    Use this setup if you have cloned the repository and have made (or want to make)
    changes to the codebase.

1. Copy `.env.template` to `.env`.
2. Follow the standard [configuration instructions](./index.md#completing-the-setup),
   from step 3 onwards and excluding `poetry install` steps.

## Running AutoGPT with Docker

After following setup instructions above, you can run AutoGPT with the following command:

```shell
docker compose run --rm auto-gpt
```

This creates and starts an AutoGPT container, and removes it after the application stops.
This does not mean your data will be lost: data generated by the application is stored
in the `data` folder.

Subcommands and arguments work the same as described in the [user guide]:

* Run AutoGPT:
    ```shell
    docker compose run --rm auto-gpt serve
    ```
* Run AutoGPT in TTY mode, with continuous mode.
    ```shell
    docker compose run --rm auto-gpt run --continuous
    ```
* Run AutoGPT in TTY mode and install dependencies for all active plugins:
    ```shell
    docker compose run --rm auto-gpt run --install-plugin-deps
    ```

If you dare, you can also build and run it with "vanilla" docker commands:

```shell
docker build -t autogpt .
docker run -it --env-file=.env -v $PWD:/app autogpt
docker run -it --env-file=.env -v $PWD:/app --rm autogpt --gpt3only --continuous
```

[user guide]: ../usage.md/#command-line-interface