Magento 1 reached end of life on June 30, 2020. Adobe no longer provides security patches. Do not deploy Magento 1 in production.
OpenMage LTS is a community-maintained fork with security patches and bug fixes.
Current OpenMage Version: 20.2.x (2025)
This guide deploys OpenMage LTS (or Magento 1 for legacy use) with Docker Compose on Debian 10+, Ubuntu 20.04+, or RHEL 9+.
- name: Deploy OpenMage LTS (Magento 1 fork)
hosts: magento
become: true
vars:
app_root: /opt/openmage
app_port: 8080
openmage_version: "v20.2.0"
db_name: magento
db_user: magento
db_password: "change-me-strong-password"
db_root_password: "change-me-strong-password"
tasks:
- name: Install Docker on Debian/Ubuntu
apt:
name:
- docker.io
- docker-compose-plugin
state: present
update_cache: true
when: ansible_os_family == "Debian"
- name: Install Docker on RHEL family
dnf:
name:
- docker
- docker-compose-plugin
state: present
when: ansible_os_family == "RedHat"
- name: Enable and start Docker
service:
name: docker
state: started
enabled: true
- name: Create app directory
file:
path: "{{ app_root }}"
state: directory
mode: "0755"
- name: Write Docker Compose file for OpenMage
copy:
dest: "{{ app_root }}/docker-compose.yml"
mode: "0644"
content: |
version: '3.8'
services:
db:
image: mariadb:10.6
restart: unless-stopped
environment:
MYSQL_DATABASE: {{ db_name }}
MYSQL_USER: {{ db_user }}
MYSQL_PASSWORD: {{ db_password }}
MYSQL_ROOT_PASSWORD: {{ db_root_password }}
volumes:
- db_data:/var/lib/mysql
networks:
- magento-net
web:
build: .
restart: unless-stopped
depends_on:
- db
ports:
- "{{ app_port }}:80"
volumes:
- magento_app:/var/www/html
networks:
- magento-net
volumes:
db_data:
magento_app:
networks:
magento-net:
- name: Write Dockerfile for OpenMage
copy:
dest: "{{ app_root }}/Dockerfile"
mode: "0644"
content: |
FROM php:8.0-apache
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libicu-dev \
libxml2-dev \
libxslt1-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install pdo_mysql mysqli gd intl soap xsl xml \
&& a2enmod rewrite headers ssl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html
RUN git clone https://github.com/OpenMage/magento-lts.git . \
&& git checkout {{ openmage_version }} \
&& chown -R www-data:www-data /var/www/html
EXPOSE 80
- name: Build and start application stack
command: docker compose up -d --build
args:
chdir: "{{ app_root }}"
- name: Wait for application to be ready
wait_for:
port: "{{ app_port }}"
timeout: 60
For traditional installation without containers:
- name: Deploy OpenMage LTS (Direct Installation)
hosts: magento
become: true
vars:
app_root: /var/www/html/magento
web_user: www-data
db_name: magento
db_user: magento
db_password: "change-me-strong-password"
openmage_version: "v20.2.0"
tasks:
- name: Install LAMP stack and dependencies
apt:
name:
- apache2
- mariadb-server
- libapache2-mod-php
- php-mysql
- php-curl
- php-gd
- php-intl
- php-mbstring
- php-xml
- php-soap
- php-xsl
- composer
- git
state: present
update_cache: true
- name: Enable Apache mod_rewrite
command: a2enmod rewrite
notify: restart apache
- name: Start and enable MariaDB
service:
name: mariadb
state: started
enabled: true
- name: Create database
mysql_db:
name: "{{ db_name }}"
state: present
login_unix_socket: /var/run/mysqld/mysqld.sock
- name: Create database user
mysql_user:
name: "{{ db_user }}"
password: "{{ db_password }}"
priv: "{{ db_name }}.*:ALL"
state: present
login_unix_socket: /var/run/mysqld/mysqld.sock
- name: Clone OpenMage LTS repository
git:
repo: https://github.com/OpenMage/magento-lts.git
dest: "{{ app_root }}"
version: "{{ openmage_version }}"
- name: Set ownership
file:
path: "{{ app_root }}"
owner: "{{ web_user }}"
group: "{{ web_user }}"
recurse: yes
- name: Set directory permissions
command: find {{ app_root }} -type d -exec chmod 755 {} \;
- name: Set file permissions
command: find {{ app_root }} -type f -exec chmod 644 {} \;
- name: Configure Apache virtual host
template:
src: templates/magento-vhost.j2
dest: /etc/apache2/sites-available/magento.conf
notify: restart apache
- name: Enable Magento site
command: a2ensite magento
notify: restart apache
handlers:
- name: restart apache
service:
name: apache2
state: restarted
http://YOUR-SERVER:8080