Install WordPress with Podman Compose

Install WordPress dengan Podman Compose

Install Podman and Podman Compose on Ubuntu 20.04 / 22.04


  • Buat directory dengan nama wp
root@sys-ops:~# mkdir wp && cd wp
  • Buat file compose.yml di dalam directory wp
root@sys-ops:~/wp# nano compose.yml
version: "3.0"
services:
  web-wp:
    container_name: web-wp
    image: docker.io/library/wordpress
    restart: always
    volumes:
      - wordpress:/var/www/html
    ports:
      - 8090:80
    environment:
      WORDPRESS_DB_HOST: db-wp
      WORDPRESS_DB_USER: user-wp
      WORDPRESS_DB_NAME: db-wp
      WORDPRESS_DB_PASSWORD: pass-wp
    depends_on:
      - db-wp
    networks:
      - wpnet
  db-wp:
    container_name: db-wp
    image: docker.io/library/mariadb:10.6
    restart: always
    volumes:
      - mariadb:/var/lib/mysql
    environment:
      MYSQL_DATABASE: db-wp
      MYSQL_USER: user-wp
      MYSQL_PASSWORD: pass-wp
      MYSQL_ROOT_PASSWORD: pass-root
    networks:
      - wpnet
volumes:
  wordpress: {}
  mariadb: {}
networks:
  wpnet: {}
  • Jalankan podman compose
root@sys-ops:~/wp# podman-compose up -d
  • Cek status container
root@sys-ops:~/wp# podman-compose ps
['podman', '--version', '']
using podman version: 3.4.2
podman ps -a --filter label=io.podman.compose.project=wp
CONTAINER ID  IMAGE                               COMMAND               CREATED         STATUS             PORTS                 NAMES
c8843502312f  docker.io/library/mariadb:10.6      mariadbd              43 seconds ago  Up 41 seconds ago                        db-wp
f2d4dcb9fcb0  docker.io/library/wordpress:latest  apache2-foregroun...  39 seconds ago  Up 38 seconds ago  0.0.0.0:8090->80/tcp  web-wp
  • Akses wordpress lewat browser dengan url: http://ip_server:8090

herdiana3389

A system administrator with skills in system administration, virtualization, linux, windows, networking, cloud computing, container, etc.