Skip to content

2. Setting up PrestaShop on Rocky Linux 10 with Docker

Setting up PrestaShop using Docker, and pulling an image from our GitLab registry, configuring Nginx with Let's Encrypt SSL.

Original Author: Eino Puttonen, Provodin Grigory
Last updated by Jesse Anttila
Last checked by Henri Kautto
Version 0.2
Lastmod: 28.01.2026
Status: OK
Comments: Tested on a fresh Rocky 10 virtual machine, works as expected

Notes#

Create a NEW, CLEAN Rocky Linux virtual machine on cPouta for V1! Otherwise there might be conflicts!

Introduction#

In this guide we will install PrestaShop on a Rocky Linux based cPouta instance using Docker and Docker Compose. We will use container images from our internal Gitlab registry. Lastly, we will finish PrestaShop installation in the browser using the values we defined in docker-compose.yml

Prerequisites#

  • Rocky Linux 10 running on a CSC cPouta virtual machine
  • Ports 80 and 443 open

Docker setup#

  1. Initial updates and installs
# Update repositories
sudo dnf update -y
sudo reboot

Wait a moment and ssh back in.

# Install prerequisites
sudo dnf install epel-release dnf-utils dnf-plugins-core nano -y
# Find the domain address of your virtual machine
sudo dnf install bind-utils -y

# nslookup 86.50.XXX.XXX
# nslookup FLOATING_IP
nslookup PUBLIC_IP_OF_VM

Save your fip-aaa-bbb-ccc-ddd.kaj.poutavm.fi address somewhere. The domain of your virtual machine is based on the public (floating) IP address. You can either find it with nslookup or figure it out based on your IP address (aaa-bbb-ccc-ddd is based on aaa.bbb.ccc.ddd where the dot . is replaced by -)

  1. Add Docker repository and install Docker
# Add Docker repo
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

# Install the needed packages
sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y

# Install kernel modules

sudo dnf install -y kernel-modules kernel-modules-extra

# Check docker status

systemctl status docker.service

# Start and enable Docker (dockerd)
sudo systemctl enable --now docker

# Test Docker
sudo docker run hello-world

Optionally, add your current user to the docker group so you are able to manage docker without sudo. Needs re-login for the group change to take effect.

# Add the current user
sudo usermod -a -G docker $(whoami)
  1. Docker network and directories
sudo docker network create prestashop-net

mkdir -p ~/prestashop-docker/presta-shop-code
mkdir -p ~/prestashop-docker/ssl
  1. Create a Docker compose file
cd prestashop-docker
nano docker-compose.yml

Here is a sample configuration you can add. Make sure you update the following values:

  • Replace fip-aaa-bbb-ccc-ddd.kaj.poutavm.fi with your instance's domain
  • Replace XXXX@student.jamk.fi with a valid email address
services:
  # MySQL Database
  mysql:
    container_name: presta-mysql
    image: gitlab.labranet.jamk.fi:4567/ref-product-line-v1-2025/ref-product-service-mysql-database-container-v1:latest
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: admin
      MYSQL_DATABASE: prestashop
    volumes:
      - dbdata:/var/lib/mysql # Persist database content
    networks:
      - prestashop-net

  # PrestaShop Application
  prestashop:
    container_name: prestashop
    image: gitlab.labranet.jamk.fi:4567/ref-product-line-v1-2025/ref-product-presta-shop-service-container-v1:latest
    depends_on:
      - mysql
    environment:
      DB_SERVER: presta-mysql
      DB_NAME: prestashop
      DB_USER: root
      DB_PASSWD: admin
      PS_FOLDER_ADMIN: admin32sfcxe2  # Renaming admin folder for security
      PS_SHOP_DOMAIN: fip-aaa-bbb-ccc-ddd.kaj.poutavm.fi
      PS_SHOP_SSL_ENABLED: "1"
      VIRTUAL_HOST: fip-aaa-bbb-ccc-ddd.kaj.poutavm.fi
      LETSENCRYPT_HOST: fip-aaa-bbb-ccc-ddd.kaj.poutavm.fi
      LETSENCRYPT_EMAIL: XXXX@student.jamk.fi
    volumes:
      - presta-code:/var/www/html # Persist website data
    networks:
      - prestashop-net

  # Nginx Reverse Proxy
  nginx-proxy:
    container_name: nginx-proxy
    image: jwilder/nginx-proxy
    restart: unless-stopped
    ports:
      - "80:80" # HTTP
      - "443:443" # HTTPS
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./ssl:/etc/nginx/certs
      - ./html:/usr/share/nginx/html:rw
    networks:
      - prestashop-net

  # LetsEncrypt companion
  letsencrypt:
    container_name: letsencrypt
    image: nginxproxy/acme-companion
    environment:
      NGINX_PROXY_CONTAINER: nginx-proxy
      ACME_CA_URI: https://acme-v02.api.letsencrypt.org/directory
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./ssl:/etc/nginx/certs:rw # Persist SSL certificates
      - ./html:/usr/share/nginx/html:rw
    depends_on:
      - nginx-proxy
    networks:
      - prestashop-net

networks:
  prestashop-net:

volumes:
  dbdata:
  presta-code:
  1. Docker Registry Login

First, go to: GitLab → Your profile → Edit profile → Access Tokens → Create token with read_registry scope.

Then, on your server, login using Docker:

docker login gitlab.labranet.jamk.fi:4567
# Username: <YOUR_GITLAB_USERNAME>
# Password: <ACCESS_TOKEN>
  1. Start Containers
sudo docker compose up -d
sudo docker ps -a

NOTE: If you get an error when starting docker compose sudo docker compose up -d, something along the lines of denied: access forbidden, try running the command without sudo

# (Optional) Check Let's Encrypt log to confirm SSL installation
sudo docker logs -f letsencrypt

After this, visit your domain in the browser to finish installation of your PrestaShop site: fip-aaa-bbb-ccc-ddd.kaj.poutavm.fi

  1. Browser installation wizard

    Access your PrestaShop installation on any browser and finish the installation wizard there. Following are the details you need to enter for the database (these are defined in the docker-compose.yml file that we created earlier.)

    - Database server address: presta-mysql - Database name: prestashop - Database login: root - Database password: admin

Successful database connection

Click next to proceed with the installation.

  1. Remove install folder from container

After you are done with the installation wizard, delete the install folder (for security reasons) by running the following commands on the server:

sudo docker exec -it prestashop bash
rm -rf /var/www/html/install
exit

You should now have a Let’s Encrypt certified PrestaShop running at fip-aaa-bbb-ccc-ddd.kaj.poutavm.fi. Congratulations.

Troubleshooting#

  • Ensure MySQL is ready before PrestaShop starts; consider retrying connections if needed.
  • Check folder permissions for ./ssl and ./html.
  • Verify DNS points correctly to the server for SSL to work.
  • If Docker reports irrelevant sections, check YAML indentation and Compose version.
  • Make sure port 80 and 443 are open!

References#