Skip to main content

Running with Docker

Running it locally#

To run server locally you should be fine just with running simple docker image with mounted data volume. By default Tolgee is using H2 database to store the data so you don't need another database to run 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.yml
version: '3'
services:  db:    image: postgres:11    environment:      - POSTGRES_PASSWORD=postgres  app:    image: tolgee/tolgee    volumes:     - ./data:/data    ports:      - "8090:8080"    env_file:      - .env    depends_on:      - "db"

To provide a configuration, add following .env file.

.env
spring.datasource.url=jdbc:postgresql://db:5432/postgresspring.datasource.username=postgresspring.datasource.password=postgres

Similarly, you can define other configuration properties.

info

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

.env
spring_datasource_url=jdbc:postgresql://db:5432/postgresspring_datasource_username=postgresspring_datasource_password=postgres

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

The is now accessible on http://localhost:8090.