Skip to content

Run Docker with data container

To run Docker with data container:

  1. Create a persistent data container:

    docker create --volume /srv \
    --name pmm-data \
    percona/pmm-server:2 /bin/true
    

    Important

    PMM Server expects the data volume to be /srv. Using any other value will result in data loss when upgrading.

    To check server and data container mount points:

    docker inspect pmm-data | grep Destination && \
    docker inspect pmm-server | grep Destination
    
  2. Create the Docker network:

    docker network create pmm_default
    
  3. Run the image:

    docker run --detach --restart always \
    --publish 443:8443 \
    --env PMM_WATCHTOWER_HOST=your_watchtower_host \
    --env PMM_WATCHTOWER_TOKEN=your_watchtower_token \
    --volumes-from pmm-data \
    --network=pmm_default \
    --name pmm-server \
    perconalab/pmm-server:3.0.0-rc
    
  4. Change the password for the default admin user:

    docker exec -t pmm-server change-admin-password <new_password>
    
  5. Check the WatchTower prerequisites and pass the following command to Docker Socket to start Watchtower:

    docker run -v /var/run/docker.sock:/var/run/docker.sock -e WATCHTOWER_HTTP_API_UPDATE=1 -e WATCHTOWER_HTTP_API_TOKEN=your_watchtower_token --hostname=your_watchtower_host --network=pmm_default docker.io/perconalab/watchtower
    
  6. Visit https://localhost:443 to see the PMM user interface in a web browser. (If you are accessing the docker host remotely, replace localhost with the IP or server name of the host.)

Get expert help

If you need assistance, you can find comprehensive and free database knowledge on our community forum or blog posts. For professional support and services, contact our Percona Database Experts.