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.
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
80and443open
Docker setup#
- Initial updates and installs
Wait a moment and ssh back in.
# 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 -)
- 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.
- Docker network and directories
sudo docker network create prestashop-net
mkdir -p ~/prestashop-docker/presta-shop-code
mkdir -p ~/prestashop-docker/ssl
- Create a Docker compose file
Here is a sample configuration you can add. Make sure you update the following values:
- Replace
fip-aaa-bbb-ccc-ddd.kaj.poutavm.fiwith your instance's domain - Replace
XXXX@student.jamk.fiwith 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:
- 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>
- Start Containers
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
After this, visit your domain in the browser to finish installation of your PrestaShop site: fip-aaa-bbb-ccc-ddd.kaj.poutavm.fi
- 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.ymlfile that we created earlier.)- Database server address:
presta-mysql- Database name:prestashop- Database login:root- Database password:admin

Click next to proceed with the installation.
- 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:
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
./ssland./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
80and443are open!