This guide provides step-by-step instructions on how to deploy OpenCart using Docker, access and manage the MariaDB database, and update the administrator password for OpenCart.
- Docker installed on your system Docker installation guide.
- Basic knowledge of Docker and command-line interface
- Pull OpenCart and MariaDB Images from official bitnami container: Simply run this command in terminal.
curl -sSL https://raw.githubusercontent.com/bitnami/containers/main/bitnami/opencart/docker-compose.yml > docker-compose.yml
docker-compose up -d
- Web Interface: OpenCart will be accessible at
http://localhost/
.
-
Accessing the MariaDB Container: Run the following command to access the MariaDB container:
docker exec -it <mariadb-container-name> /bin/bash
Replace
<mariadb-container-name>
with the actual name of your MariaDB container. -
Accessing the MariaDB Console: Once inside the container, connect to the MariaDB database:
mysql -u bn_opencart -p
When prompted, enter the password. default image doesn't have password so simply enter
-
Changing the Administrator Password:
a. Select the OpenCart database:
USE bitnami_opencart;
b. Update the administrator password (replace
new_password
with the actual new password):UPDATE oc_user SET password = MD5('new_password') WHERE username = 'user';
-
Exit the MariaDB Console: Type
exit;
and press Enter.
To stop and remove all containers, networks, and volumes defined in the docker-compose.yml
file, navigate to the directory containing the file and run:
docker-compose down -v
You have successfully deployed OpenCart using Docker, accessed the MariaDB database, and updated the administrator password. OpenCart is now ready for use. Ensure to follow best practices for production deployments, such as securing the database and using strong, securely hashed passwords.
Hello @ovicko, this guide provides comprehensive instructions based on the official Bitnami OpenCart image. Should you require a custom image, feel free to follow the steps outlined here to create one tailored to your needs: bitnami/opencart.