Install phpRedisAdmin Inside Docker Container in Linux

Install phpRedisAdmin Inside Docker Container in Linux

The phpRedisAdmin is an administration tool that allows to manage Redis database through a web browser. It is an open-source project that released under the Creative Commons Attribution 3.0 license.

This tutorial explains how to install phpRedisAdmin inside a Docker container in the Linux. Commands have been tested on Ubuntu.

Prepare environment

Make sure you have installed Docker in your system. If you are using Ubuntu, installation instructions can be found in the post.

You also need to have a running Redis container. Instructions can be found in the post.

Install phpRedisAdmin

  • Host network

Run the following command to create a container for phpRedisAdmin that uses host network:

docker run -d --name=phpredisadmin --restart=always --network=host \
    -e ADMIN_USER=admin \
    -e ADMIN_PASS=pwd123 \
    -e REDIS_1_HOST=127.0.0.1 \
    erikdubbelboer/phpredisadmin

Redis container should run on host network as well.

  • User-defined bridge network

User-defined bridge network can be used for listening on different port. By default, phpRedisAdmin service is listening on port 80. It can be changed with -p option.

docker network create app-net
docker run -d --name=phpredisadmin --restart=always --network=app-net \
    -p 8080:80 \
    -e ADMIN_USER=admin \
    -e ADMIN_PASS=pwd123 \
    -e REDIS_1_HOST=redis \
    erikdubbelboer/phpredisadmin

Redis container should run on the same user-defined bridge network as well.

Notes:

  • Don't forget to change admin password for phpRedisAdmin using ADMIN_PASS.
  • When user-defined bridge network is used, don't forget to change REDIS_1_HOST. It specifies Redis container name.

Testing phpRedisAdmin

Open a web browser and go to http://<IP_ADDRESS>, where <IP_ADDRESS> is the IP address of the system. Log in to the administrative interface with the admin username and password.

phpRedisAdmin Inside Docker Container in Linux

Uninstall phpRedisAdmin

To completely remove phpRedisAdmin, remove its container:

docker rm --force phpredisadmin

Remove phpRedisAdmin image:

docker rmi erikdubbelboer/phpredisadmin

If a user-defined bridge network was created, you can delete it as follows:

docker network rm app-net

Leave a Comment

Cancel reply

Your email address will not be published.