Skip to main content
Version: 3.x.x

Running with Docker

info

Since v2, Tolgee runs PostgreSQL database in its container by default. To disable embedded Postgres, set tolgee.postgres-autostart.enabled property to false.

To run server locally you should be fine just with running simple Docker image with mounted data volume. Tolgee has embedded PostgresSQL database, so you don't have to manually set it.

docker run -v tolgee_data:/data/ -p 8085:8080 tolgee/tolgee

This will:

  • mount tolgee_data volume into it's directory inside the container
  • expose tolgee container port on port 8085
  • run the image!

Now you should be able to access Tolgee web application on http://localhost:8085

Running with compose

To run it on company infrastructure it is better to use some more optimized database system. Tolgee supports PostgreSQL. You can run it using docker-compose. To start let's create and enter a folder to store Tolgee related files:

mkdir tolgee && cd tolgee

Create a file named docker-compose.yml containing following content.

docker-compose.yaml
version: '3'

services:
app:
image: tolgee/tolgee
volumes:
- ./data:/data
ports:
- "25432:25432" # if you would like to access the DB
- "8080:8080"

Configuring using configuration file

The recommended way of configuring the application is using configuration file.

To do so, you have to create the config.yaml file containing configuration properties in the same directory as docker-compose.yaml. You can find the list of all properties in configuration reference.

docker-compose.yaml
version: '3'

services:
app:
image: tolgee/tolgee
volumes:
- ./data:/data
- ./config.yaml:/config.yaml # <--- this line
ports:
- "25432:25432"
- "8080:8080"
environment:
spring.config.additional-location: file:///config.yaml # <--- this line
config.yaml
tolgee:
machine-translation:
google:
api-key: my_google_api_key
authentication:
enabled: true
user-can-create-organizations: true
smtp:
from: Tolgee <no-reply@mydomain.com>
host: email-smtp.regional-region.amazonaws.com
username: "OMGTHISISUSERNAME"
password: "omg/my/password"
auth: true
port: 465
ssl-enabled: true

Configuring using environmental variables

You can provide the configuration variables using environment variables or using .env file.

docker-compose.yaml
version: '3'

services:
app:
image: tolgee/tolgee
volumes:
- ./data:/data
- ./config.yaml:/config.yaml
ports:
- "25432:25432"
- "8080:8080"
env_file:
- .env

To provide a configuration, add following .env file.

.env
spring.datasource.url=jdbc:postgresql://db:5432/postgres
spring.datasource.username=postgres
spring.datasource.password=postgres
tolgee.postgres-autostart.enabled=false

Similarly, you can define other configuration properties.

info

Some versions of docker-compose doesn't accept . or - in .env file key names. Then you can replace . and - characters with underscores _.

.env
spring_datasource_url=jdbc:postgresql://db:5432/postgres
spring_datasource_username=postgres
spring_datasource_password=postgres
tolgee_postgres_autostart_enabled=false

Your initial username is admin. Initial password is automatically generated and stored in /data/initial.pwd file in the Tolgee container. You can print it by executing this:

cat data/initial.pwd