πŸš€ Step-by-Step Guide to Install MediaCMS on WSL

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Sure! Let’s set up MediaCMS from scratch on your system at /opt/wizbrand/mediacms-4.4.1. This guide will ensure you remove everything and install it cleanly.

This guide covers: βœ… Removing existing Docker containers
βœ… Reinstalling and configuring MediaCMS
βœ… Setting up PostgreSQL, Redis, and Python virtual environment
βœ… Running and accessing MediaCMS


1️⃣ Step 1: Remove All Existing Containers, Images, and Volumes

Since you want a fresh setup, let’s remove everything.

πŸ—‘οΈ Remove Old Containers and Images

docker-compose down -v --rmi all --remove-orphans
docker system prune -a --volumes -f

This will:

  • Stop and remove all containers.
  • Remove all Docker images.
  • Clear all volumes.

2️⃣ Step 2: Install Required Dependencies

Before installing MediaCMS, install the required software:

πŸ–₯️ Install Docker & Docker Compose

Ensure Docker is installed:

sudo apt update
sudo apt install -y docker.io docker-compose

Start and enable Docker:

sudo systemctl enable --now docker

Verify installation:

docker --version
docker-compose --version

🐍 Install Python & Virtualenv

MediaCMS requires Python, so install it:

sudo apt install -y python3 python3-venv python3-pip

Verify Python installation:

python3 --version

3️⃣ Step 3: Clone MediaCMS Repository (If Needed)

If you haven’t cloned MediaCMS yet, do this:

cd /opt/wizbrand
git clone https://github.com/mediacms-io/mediacms.git mediacms-4.4.1
cd mediacms-4.4.1

If you already have the project, just navigate to it:

cd /opt/wizbrand/mediacms-4.4.1

4️⃣ Step 4: Configure Environment Variables

Before running Docker, ensure the .env file has correct settings.

πŸ“Œ Create/Edit the .env File

nano .env

Add the following:

DB_HOST=db
DB_NAME=mediacms
DB_USER=mediacms_user
DB_PASSWORD=yourpassword

REDIS_HOST=redis
REDIS_PORT=6379

Save and exit (CTRL + X, then Y + Enter).


5️⃣ Step 5: Build & Run MediaCMS Containers

πŸ”¨ Build and Start MediaCMS

Run:

docker-compose up --build -d

This will:

  • Pull the required Docker images.
  • Build the MediaCMS container.
  • Start PostgreSQL, Redis, and Web services.

6️⃣ Step 6: Verify Running Containers

Check if all services are running:

docker ps

Expected output:

CONTAINER ID   IMAGE                      COMMAND                  STATUS          PORTS
abcd1234       mediacms/mediacms:latest   "./deploy/docker/ent…"   Up X minutes    8000/tcp
efgh5678       redis:alpine               "docker-entrypoint.s…"   Up X minutes    6379/tcp
ijkl9101       postgres:17.2-alpine       "docker-entrypoint.s…"   Up X minutes    5432/tcp

If any container is Restarting or Exited, check logs:

docker logs <container_id>

7️⃣ Step 7: Run Database Migrations Manually (If Needed)

If MediaCMS is stuck, you may need to run migrations.

πŸ” Enter the Web Container

docker exec -it mediacms-441_web_1 bash

🐍 Set Up Python Virtual Environment

python3 -m venv /home/mediacms.io/mediacms/venv
source /home/mediacms.io/mediacms/venv/bin/activate
pip install --upgrade pip
pip install -r /home/mediacms.io/mediacms/requirements.txt

πŸ“Œ Apply Migrations

python manage.py migrate
python manage.py collectstatic --noinput
exit

Restart the container:

docker-compose restart

8️⃣ Step 8: Access MediaCMS

If everything is working, open your browser and go to:

http://localhost:8000

or

http://your-server-ip:8000

πŸ”₯ Troubleshooting

If you face any issues, try the following:

πŸ“Œ 1. Check Container Logs

docker-compose logs

For a specific container:

docker logs mediacms-441_web_1

πŸ“Œ 2. Restart Everything

docker-compose down
docker-compose up -d --build

πŸ“Œ 3. Verify PostgreSQL is Running

docker exec -it mediacms-441_db_1 psql -U mediacms_user -d mediacms -c "\dt"

βœ… Final Checklist

βœ… Docker is installed and running
βœ… MediaCMS .env file is set up
βœ… Containers are running (docker ps)
βœ… Database migrations are applied
βœ… MediaCMS is accessible at http://localhost:8000


πŸŽ‰ You’ve successfully installed MediaCMS on WSL! Let me know if you face any issues. πŸš€

Senior Software Development Engineer at Cotocus

Related Posts

Complete Guide to Treatment Planning and Hospital Discovery Worldwide

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now It…

Read More

Global Healthcare Decisions Made Easier With MyHospitalNow Platform

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now Introduction…

Read More

Common DevSecOps Implementation Mistakes and How to Fix Them

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now Introduction…

Read More

Ultimate DevSecOps Learning Roadmap to Move from DevOps to Cloud Security

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now Introduction…

Read More

Comprehensive Guide to DevSecOps in Modern Software Engineering

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now Introduction…

Read More

DevSecOps in Modern Software Engineering: A Comprehensive Guide for Professionals

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now Introduction…

Read More
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments