The Official GoToSocial docker images are provided through [docker hub](https://hub.docker.com/r/superseriousbusiness/gotosocial "docker hub gotosocial").
GoToSocial can be configured using [Environment Variables](../configuration/index.md#environment-variables) if you wish, allowing your GoToSocial configuration to be embedded inside your docker container configuration.
## Run with Docker Compose (recommended)
This guide will lead you through the installation with [docker compose](https://docs.docker.com/compose/ "Docker Compose Docs"), so you might want to follow the next Steps.
### Create a Working Dir
You need a Working Directory in which the data of the PostgreSQL and the GoToSocial container will be located, so create this directory for example with the following command.
The directory can be located where you want it to be later.
```shell
mkdir -p /docker/gotosocial
cd /docker/gotosocial
```
### Get the latest docker-compose.yaml and config.yaml
You can get an example [docker-compose.yaml](../../example/docker-compose/docker-compose.yaml "Example docker-compose.yaml") and [config.yaml](../../example/config.yaml "Example config.yaml") here, which you can download with wget for example.
You can modify the docker-compose.yaml to your needs, but in any case you should generate a Postgres password and bind it as environment variable into the postgreSQL container. For this we can write the password directly into the docker-compose.yaml like in the example or we create an [.env file](https://docs.docker.com/compose/environment-variables/#the-env-file "Docker Docs") that will load the environment variables into the container. You may also want to check the current [GoToSocial version](https://github.com/superseriousbusiness/gotosocial/releases) and adjust the image in docker-compose.yaml.
```shell
$EDITOR docker-compose.yaml
```
### Edit the config.yaml
When we want to use the config.yaml, we should make the following changes to config.yaml.
| Config Option | Value |
| --------------- | ------ |
| host | Hostname of your Inctanse e.g. gts.example.com |
| account-domain | Domain to use when federating profiles e.g. gts.example.com |
| trusted-proxies | We need to trust our host machine and the Docker Network e.g.<br>- "127.0.0.1/32"<br>- "10.0.0.0/8"<br>- "172.16.0.0/12"<br>- "192.168.0.0/16" |
| db-address | gotosocial_postgres |
| db-user | gotosocial |
| db-password | same password as postgres environment $POSTGRES_PASSWORD |
```shell
$EDITOR config.yaml
```
### Start GoToSocial
```shell
docker-compose up -d
```
After running this command, you should get an output like:
```shell
❯ docker-compose up -d
[+] Running 2/2
⠿ Container docker1-gotosocial_postgres-1 Started
⠿ Container docker1-gotosocial-1 Started
```
this names can be used to create your first user described below.
### Create your first User
Take the names from above command `docker-compose up -d` and replace $CONTAINER_NAME with the name e.g. `docker1-gotosocial-1`
GTS_TRUSTED_PROXIES=127.0.0.1 # should be the host machine and the Docker Network e.g. "127.0.0.1/32", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"
GTS_HOST=gotosocial.example.com
GTS_ACCOUNT_DOMAIN=gotosocial.example.com
GTS_DB_TYPE=sqlite
GTS_DB_ADDRESS=/gotosocial/database/sqlite.db
GTS_STORAGE_SERVE_BASE_PATH=/gotosocial/storage
GTS_LETSENCRYPT_ENABLED=false
```
</details>
## (optional) NGINX Config
The following NGINX config is just an example of what this might look like. In this case we assume that a valid SSL certificate is present. For this you can get a valid certificate from [Let's Encrypt](https://letsencrypt.org "Let's Encrypt Homepage") with the [cerbot](https://certbot.eff.org "Certbot's Homepage").