Contents
How to Install Wagtail CMS on Different Types of Infrastructure: A Complete Step-by-Step Guide
Wagtail CMS is a powerful, open-source Content Management System built using Python and the Django web framework. It is designed for businesses, developers, publishers, institutions and organisations that need a flexible platform for creating, managing and publishing website content.
Unlike traditional content management systems that rely heavily on predefined themes and plugins, Wagtail provides a developer-friendly framework for building customised websites, business portals, directories, news platforms, corporate websites and complex digital experiences.
One of the main advantages of Wagtail is that it can run on different types of infrastructure. You can install it on a local computer, a dedicated server, a Virtual Private Server (VPS), cloud infrastructure, Docker containers, Kubernetes clusters or managed application hosting platforms.
The installation process varies depending on the infrastructure, but the underlying requirements remain largely the same. These include Python, Django, a compatible database, static file storage, a web server and an application server.
This guide explains how to install Wagtail CMS on different types of infrastructure, covering initial setup, server configuration, deployment, security, database management and ongoing maintenance.
1. Understanding Wagtail CMS Infrastructure Requirements
Before installing Wagtail, it is important to understand the components required to run the platform.
Wagtail is not simply a standalone application that you install on a web server. It operates as a Python web application built on Django.
A typical production installation consists of several interconnected components.
| Component | Purpose | Common Options |
|---|---|---|
| Operating system | Provides the server environment | Ubuntu, Debian, Rocky Linux |
| Programming language | Runs the application | Python |
| Web framework | Provides application functionality | Django |
| CMS | Manages website content | Wagtail |
| Database | Stores content and application data | PostgreSQL, SQLite for development |
| Application server | Runs Django and Wagtail | Gunicorn, Uvicorn |
| Web server | Handles HTTP requests and reverse proxying | Nginx, Apache |
| Static storage | Stores CSS, JavaScript and images | Local storage, object storage |
| Domain and DNS | Connects visitors to the website | Cloudflare DNS, registrar DNS |
| SSL certificate | Encrypts website connections | Let’s Encrypt, managed certificates |
Recommended infrastructure requirements
For a small development website, a computer with Python and SQLite may be sufficient.
For a production website, consider:
- A Linux server with a supported Python version.
- At least 2 GB of RAM for a modest installation, with additional memory for larger websites.
- A compatible PostgreSQL database.
- Sufficient disk space for media uploads, backups and application files.
- A domain name and DNS configuration.
- An SSL certificate.
- A reliable backup and monitoring system.
Actual resource requirements depend on the number of visitors, image uploads, background tasks, search functionality and website complexity.
The best infrastructure is not necessarily the most expensive. A properly configured VPS can support many business websites, while larger applications may benefit from managed databases, object storage and container orchestration.
2. Installing Wagtail CMS on a Local Computer
Installing Wagtail on a local computer is one of the easiest ways to learn the platform. It is suitable for developers, students, website designers and organisations preparing a website before publishing it online.
You can install Wagtail on Windows, Linux or macOS.
Step 1: Install Python
Download and install a compatible Python version from the official Python website.
On Windows, make sure you enable the option to add Python to the system PATH during installation.
Verify the installation using:
python --version
On some Linux and macOS systems, use:
python3 --version
Step 2: Create a project directory
Create a folder where your Wagtail website will be stored.
mkdir wagtail-project
cd wagtail-project
Step 3: Create a Python virtual environment
A virtual environment keeps the dependencies of your Wagtail project separate from other Python applications.
python -m venv venv
Activate it on Windows:
venv\Scripts\activate
On Linux or macOS:
source venv/bin/activate
Step 4: Install Wagtail
Install Wagtail using Python’s package manager:
python -m pip install --upgrade pip
python -m pip install wagtail
Step 5: Create a Wagtail project
Use the Wagtail project creation command:
wagtail start mywebsite
Enter the newly created project directory:
cd mywebsite
Install the project dependencies:
pip install -r requirements.txt
Step 6: Configure the database
For a basic development installation, Wagtail can use SQLite, which is suitable for testing and learning.
Run:
python manage.py migrate
Step 7: Create an administrator account
Create a superuser account for accessing the Wagtail administration dashboard.
python manage.py createsuperuser
Follow the prompts to enter your username, email address and password.
Step 8: Start the development server
Run:
python manage.py runserver
Open your browser and visit:
http://127.0.0.1:8000/
The Wagtail administration interface is available at:
http://127.0.0.1:8000/admin/
You now have a functional Wagtail CMS installation running on your local computer.
Important: The Django development server is intended for development and testing. Do not use it as the production application server for a public website.
3. Installing Wagtail CMS on a Linux VPS
A Virtual Private Server is one of the most popular infrastructure options for hosting Wagtail websites.
VPS hosting provides dedicated virtual computing resources, administrative access and the flexibility to configure your preferred software.
Providers commonly used for VPS hosting include DigitalOcean, Hetzner, Linode, Vultr and AWS Lightsail.
Step 1: Provision a Linux VPS
Create a new virtual server using a supported Linux distribution.
Ubuntu Server is a common choice because it has extensive Python, Django and Wagtail deployment documentation.
Choose the server specifications according to your anticipated traffic and application requirements.
Step 2: Connect to the VPS
Connect to your server using SSH:
ssh username@YOUR_SERVER_IP
Replace the placeholder with your actual server IP address.
Step 3: Update the operating system
Run:
sudo apt update
sudo apt upgrade -y
Install the required packages:
sudo apt install python3 python3-pip python3-venv \
python3-dev build-essential nginx git libpq-dev -y
Step 4: Create an application directory
Create a directory for the website:
sudo mkdir -p /var/www/wagtail
sudo chown $USER:$USER /var/www/wagtail
cd /var/www/wagtail
Step 5: Create a virtual environment
python3 -m venv venv
source venv/bin/activate
Install Wagtail:
pip install --upgrade pip
pip install wagtail gunicorn "psycopg[binary]"
Step 6: Create the Wagtail project
wagtail start mywebsite
cd mywebsite
pip install -r requirements.txt
Step 7: Configure PostgreSQL
Install PostgreSQL if it is not already available:
sudo apt install postgresql postgresql-contrib -y
Create a database and database user:
sudo -u postgres psql
Inside PostgreSQL, execute:
CREATE DATABASE wagtaildb;
CREATE USER wagtailuser WITH PASSWORD 'CHANGE_TO_A_STRONG_PASSWORD';
GRANT ALL PRIVILEGES ON DATABASE wagtaildb TO wagtailuser;
For production, also configure appropriate database ownership, schema privileges and connection security.
Update the Django database settings to use PostgreSQL instead of SQLite.
A simplified configuration looks like this:
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "wagtaildb",
"USER": "wagtailuser",
"PASSWORD": "YOUR_DATABASE_PASSWORD",
"HOST": "127.0.0.1",
"PORT": "5432",
}
}
Store database passwords in environment variables rather than committing them to your source code.
Step 8: Apply database migrations
python manage.py migrate
python manage.py createsuperuser
Step 9: Configure production settings
Set the following production settings appropriately:
DEBUG = False- A secure
SECRET_KEYsupplied through an environment variable. - Correct
ALLOWED_HOSTSvalues. - Correct CSRF trusted origins.
- Production database credentials.
- Secure cookies and HTTPS settings.
- Appropriate static and media file storage.
Collect static files:
python manage.py collectstatic --noinput
Step 10: Configure Gunicorn
Gunicorn runs the Django application and communicates with the web server.
A basic test command is:
gunicorn mywebsite.wsgi:application
For a production installation, configure Gunicorn as a systemd service so that it starts automatically and restarts when necessary.
Step 11: Configure Nginx
Create an Nginx configuration file:
sudo nano /etc/nginx/sites-available/wagtail
A simplified reverse proxy configuration is:
server {
listen 80;
server_name example.com www.example.com;
location /static/ {
alias /var/www/wagtail/mywebsite/staticfiles/;
}
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Enable the configuration:
sudo ln -s /etc/nginx/sites-available/wagtail \
/etc/nginx/sites-enabled/
Test the configuration:
sudo nginx -t
Reload Nginx:
sudo systemctl reload nginx
The final production setup should use a Unix socket or another carefully configured Gunicorn listener rather than relying on the basic test command above.
Step 12: Configure SSL
Use an SSL certificate to secure the website.
Let’s Encrypt certificates can be installed using Certbot.
After configuring DNS and ensuring the domain points to your VPS, install and configure Certbot for Nginx.
Your Wagtail website should then be accessible through HTTPS.
4. Installing Wagtail CMS Using Docker
Docker is a containerisation platform that allows developers to package applications and their dependencies into portable containers.
It is useful when deploying Wagtail across development computers, staging environments, cloud servers and production infrastructure.
Step 1: Install Docker
Download Docker Desktop for Windows or macOS, or install Docker Engine on a Linux server.
Install Docker Compose or use the Docker Compose plugin.
Verify your installation:
docker --version
docker compose version
Step 2: Create a Wagtail project
Create the project using the normal Wagtail installation process:
pip install wagtail
wagtail start mywebsite
cd mywebsite
Step 3: Create a Dockerfile
Inside the project directory, create a file named Dockerfile.
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
RUN apt-get update && apt-get install -y \
build-essential libpq-dev \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt \
&& pip install gunicorn
COPY . .
EXPOSE 8000
CMD ["gunicorn", "mywebsite.wsgi:application", \
"--bind", "0.0.0.0:8000"]
The Python version should be selected according to the compatibility requirements of your chosen Wagtail release.
Step 4: Create a Docker Compose file
Docker Compose allows you to run multiple connected containers, including Wagtail and PostgreSQL.
Create compose.yaml:
services:
web:
build: .
command: gunicorn mywebsite.wsgi:application \
--bind 0.0.0.0:8000
ports:
- "8000:8000"
environment:
DATABASE_NAME: wagtaildb
DATABASE_USER: wagtailuser
DATABASE_PASSWORD: change_this_password
DATABASE_HOST: db
depends_on:
db:
condition: service_healthy
db:
image: postgres:16
environment:
POSTGRES_DB: wagtaildb
POSTGRES_USER: wagtailuser
POSTGRES_PASSWORD: change_this_password
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U wagtailuser -d wagtaildb"]
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres_data:
The Django database configuration must read the corresponding environment variables. The example passwords are placeholders and must be replaced with secure secrets.
Step 5: Build the containers
Run:
docker compose build
Step 6: Start the containers
docker compose up -d
Step 7: Run database migrations
docker compose exec web python manage.py migrate
Step 8: Create an administrator account
docker compose exec web python manage.py createsuperuser
Step 9: Access the website
Visit:
http://localhost:8000/
The administration dashboard is:
http://localhost:8000/admin/
For production Docker deployments, add a reverse proxy, HTTPS, persistent media storage, proper secrets management, backups and container health monitoring.
5. Installing Wagtail on Dedicated Servers
Dedicated servers provide physical computing resources exclusively allocated to one customer.
They are suitable for organisations that need more control over hardware, security, networking and server configuration.
You can install Wagtail on dedicated servers from providers such as OVHcloud, Hetzner, Leaseweb and other infrastructure companies.
Installation procedure
The process is similar to installing Wagtail on a VPS, but you have more control over the physical infrastructure.
- Purchase or provision a dedicated server.
- Install Ubuntu Server, Debian or another supported Linux distribution.
- Configure SSH access and firewall rules.
- Install Python, Git, PostgreSQL and Nginx.
- Create a Python virtual environment.
- Install Wagtail and project dependencies.
- Configure the PostgreSQL database.
- Configure Gunicorn or another suitable application server.
- Configure Nginx as the reverse proxy.
- Configure domain DNS and SSL.
- Set up automated backups and monitoring.
Advantages of dedicated server installation
- Dedicated physical resources.
- Greater control over the operating system.
- Customisable network and firewall configuration.
- Ability to host multiple Wagtail applications.
- Greater flexibility for specialised workloads.
- Suitable for large content platforms and enterprise projects.
A dedicated server can also host several separate Wagtail websites using independent Python environments, databases and application configurations.
6. Installing Wagtail on Cloud Infrastructure
Cloud infrastructure offers flexible computing resources that can be increased or reduced according to application requirements.
Wagtail can run on several major cloud platforms.
A. Amazon Web Services (AWS)
AWS provides several services that can be combined to host Wagtail.
<PRIVATE_PERSON> commonly used AWS components include:
| AWS Service | Wagtail Application |
|---|---|
| EC2 | Hosts the Wagtail application |
| RDS | Managed PostgreSQL database |
| S3 | Media and static file storage |
| CloudFront | Content delivery network |
| Application Load Balancer | Distributes application traffic |
| Route 53 | DNS management |
| CloudWatch | Monitoring and logging |
| Secrets Manager | Stores application credentials |
Installation approach
- Create an AWS account.
- Provision an EC2 instance with a supported Linux distribution.
- Install Python and the required system packages.
- Create a Wagtail application.
- Provision a PostgreSQL database using Amazon RDS.
- Configure the Django database connection.
- Configure Amazon S3 for media storage.
- Configure Gunicorn and Nginx.
- Set up a load balancer where necessary.
- Configure DNS and HTTPS.
- Monitor the application using CloudWatch.
For larger websites, multiple EC2 instances can run the same Wagtail application behind a load balancer.
B. Google Cloud Platform (GCP)
Google Cloud provides several hosting approaches for Wagtail.
| Google Cloud Service | Application |
|---|---|
| Compute Engine | Virtual machine hosting |
| Cloud Run | Containerised application hosting |
| Cloud SQL | Managed PostgreSQL |
| Cloud Storage | Media and static files |
| Cloud Load Balancing | Traffic distribution |
| Cloud CDN | Content delivery |
| Cloud Monitoring | Performance monitoring |
| Secret Manager | Secure credentials |
Installing Wagtail on Google Compute Engine
- Create a Google Cloud project.
- Enable the required cloud services.
- Provision a Compute Engine virtual machine.
- Connect through SSH.
- Install Python, PostgreSQL client libraries and Nginx.
- Create the Wagtail project.
- Configure Cloud SQL or a local PostgreSQL database.
- Configure static and media storage.
- Deploy Gunicorn.
- Configure DNS and SSL.
Installing Wagtail on Google Cloud Run
Cloud Run is suitable for running containerised Wagtail applications without directly managing virtual machines.
The general procedure is:
- Create a Wagtail project.
- Build a production Docker image.
- Store the image in Google Artifact Registry.
- Provision Cloud SQL for PostgreSQL.
- Configure Cloud Storage for uploaded media.
- Configure application environment variables and secrets.
- Deploy the container to Cloud Run.
- Configure the domain and HTTPS.
- Monitor the application.
Cloud Run instances can scale according to demand. However, persistent media and database storage should be external to the container because application instances may be replaced.
C. Microsoft Azure
Azure supports Wagtail through virtual machines, container services and managed application hosting.
Common services include:
| Azure Service | Purpose |
|---|---|
| Azure Virtual Machines | Hosts Wagtail applications |
| Azure Database for PostgreSQL | Managed database |
| Azure Blob Storage | Media storage |
| Azure Container Apps | Container hosting |
| Azure Kubernetes Service | Container orchestration |
| Azure Front Door | Global content delivery |
| Azure Monitor | Application monitoring |
| Key Vault | Secure credentials |
Installation procedure
- Create an Azure account.
- Provision a Linux virtual machine or container environment.
- Install or deploy the Wagtail application.
- Provision PostgreSQL.
- Configure Blob Storage for uploaded media.
- Set up Gunicorn and the web server or managed ingress.
- Configure environment variables and secrets.
- Configure the domain and HTTPS.
- Test the website and administration dashboard.
D. DigitalOcean
DigitalOcean offers straightforward cloud infrastructure for Wagtail websites.
You can choose between:
- DigitalOcean Droplets.
- Managed PostgreSQL databases.
- Spaces object storage.
- DigitalOcean App Platform.
- Load balancers.
- Cloud firewalls.
A common installation involves creating an Ubuntu Droplet, installing Wagtail, configuring PostgreSQL and connecting the application to a domain.
For larger applications, managed databases and Spaces can help separate the application from its data and uploaded files.
7. Installing Wagtail on Managed Python Hosting Platforms
Managed Python hosting platforms simplify application deployment by taking responsibility for some of the server configuration.
They are particularly useful for developers who want to concentrate on building websites rather than maintaining Linux infrastructure.
Examples include PythonAnywhere, Fly.io, Render and Railway, subject to their current Python, database and storage capabilities.
General installation process
- Create an account with your preferred hosting provider.
- Create a new Python web application or application service.
- Upload your Wagtail project through Git.
- Select a compatible Python runtime.
- Install the dependencies from
requirements.txt. - Provision a PostgreSQL database.
- Configure database connection variables.
- Configure the WSGI application entry point.
- Configure static file collection and serving.
- Configure persistent media storage.
- Set up the domain and SSL.
- Deploy the application.
Wagtail on PythonAnywhere
PythonAnywhere provides a Python-focused hosting environment.
The general approach is to create a Python web application, upload the project, create a virtual environment, install dependencies and configure the WSGI file to point to the Django application.
PostgreSQL availability depends on the hosting plan and current platform offering.
One important consideration is media storage. Make sure uploaded images and documents are stored persistently rather than in temporary application locations.
Wagtail on Render
Render can host Python web services and managed PostgreSQL databases.
A typical deployment requires:
- A Git repository containing the Wagtail project.
- A compatible Python runtime.
- A build command that installs dependencies.
- A start command that launches Gunicorn.
- A managed PostgreSQL database.
- Persistent object storage for uploaded media.
A typical start command is:
gunicorn mywebsite.wsgi:application
Set environment variables for the database connection, secret key, allowed hosts and other production settings.
Wagtail on Fly.io
Fly.io supports containerised Python applications.
The installation process involves building a Docker image, configuring the application through Fly configuration files, provisioning PostgreSQL and connecting external object storage for uploaded media.
It is particularly useful for developers who want to deploy containerised applications close to their target audiences.
8. Installing Wagtail Using Kubernetes
Kubernetes is a container orchestration platform used to deploy, manage and scale containerised applications.
It is particularly suitable for large Wagtail installations, enterprise websites, multi-site platforms and applications with complex infrastructure requirements.
Kubernetes can be deployed on private infrastructure or through managed services such as:
- Amazon Elastic Kubernetes Service (EKS).
- Google Kubernetes Engine (GKE).
- Azure Kubernetes Service (AKS).
- DigitalOcean Kubernetes.
- Self-managed Kubernetes clusters.
Step 1: Create a Wagtail Docker image
Build a production Docker image containing:
- Python.
- Wagtail.
- Django.
- Project dependencies.
- Gunicorn.
- Application source files.
Push the image to a container registry.
Step 2: Create a Kubernetes cluster
Provision a Kubernetes cluster using your preferred provider.
Configure the cluster networking, access permissions and container registry credentials.
Step 3: Configure PostgreSQL
Use a managed PostgreSQL database or a properly managed database service within your infrastructure.
Configure secure database access and connection pooling where necessary.
Step 4: Create application secrets
Store sensitive information such as:
- Django secret key.
- Database credentials.
- Storage credentials.
- Third-party API keys.
Use Kubernetes Secrets or an external secrets management system.
Step 5: Create a deployment configuration
A simplified Kubernetes Deployment manifest looks like this:
apiVersion: apps/v1
kind: Deployment
metadata:
name: wagtail-web
spec:
replicas: 2
selector:
matchLabels:
app: wagtail-web
template:
metadata:
labels:
app: wagtail-web
spec:
containers:
- name: wagtail
image: registry.example.com/wagtail:latest
ports:
- containerPort: 8000
env:
- name: DEBUG
value: "False"
This is an illustrative starting point. A complete deployment must also define secret references, health checks, resource requests and limits, configuration, database access and persistent or object storage.
Step 6: Configure a Kubernetes Service
A Service exposes the application internally within the cluster.
apiVersion: v1
kind: Service
metadata:
name: wagtail-service
spec:
selector:
app: wagtail-web
ports:
- port: 80
targetPort: 8000
Step 7: Configure Ingress
Ingress manages external access to the application.
You can use an Nginx Ingress Controller or a managed ingress solution.
Configure the domain, routing rules and HTTPS certificates.
Step 8: Deploy the application
Apply the configuration files:
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
Check the application:
kubectl get pods
kubectl get services
For a production deployment, database migrations should be executed through a controlled release or one-off job rather than independently by every application replica.
Advantages of Kubernetes hosting
- Horizontal application scaling.
- Automated container recovery.
- Resource management.
- Deployment automation.
- Flexible networking.
- Support for complex enterprise environments.
Kubernetes adds operational complexity. It is not necessary for every Wagtail website, particularly small business websites that can run comfortably on a VPS or managed platform.
9. Installing Wagtail on Shared Hosting
Traditional shared hosting is commonly designed for PHP applications such as WordPress, Joomla and Drupal.
Many shared hosting packages do not provide the Python runtime, background process management or WSGI support needed to operate Wagtail reliably.
However, some hosting providers offer specialised Python hosting environments.
Before purchasing a shared hosting package, confirm that it supports:
- Python applications.
- A compatible Python version.
- Django and Wagtail dependencies.
- WSGI application hosting.
- PostgreSQL or another supported database.
- Persistent file storage.
- Custom application processes.
- Environment variables.
- Static file serving.
- Background tasks where required.
Can Wagtail run on cPanel hosting?
Some cPanel installations include a Python application management feature, but availability depends on the hosting provider and server configuration.
If Python application hosting is enabled, you may be able to configure a Wagtail project through the Python application interface.
However, ordinary PHP-only shared hosting should not be assumed to support Wagtail.
For reliable production hosting, a VPS or managed Python platform is usually a better option.
10. Installing Wagtail on Windows Server
Wagtail can run on Windows-based infrastructure because Python and Django support Windows environments.
This approach may be useful for organisations that already operate Windows Server infrastructure.
Installation procedure
- Install a compatible Python version.
- Install Git.
- Create a project directory.
- Create a Python virtual environment.
- Install Wagtail.
- Generate the project.
- Configure PostgreSQL.
- Install a suitable WSGI server.
- Configure IIS or another reverse proxy.
- Configure SSL and domain access.
Create the project:
py -m venv venv
venv\Scripts\activate
pip install wagtail
wagtail start mywebsite
cd mywebsite
pip install -r requirements.txt
Apply migrations:
python manage.py migrate
python manage.py createsuperuser
Using IIS
Microsoft Internet Information Services (IIS) can be used as a web server in Windows environments.
A production arrangement can use IIS as a reverse proxy to a separately managed Python application server.
Alternatively, a suitable WSGI hosting integration can be configured.
The application server must be supervised so that it starts automatically and remains available.
Windows hosting requires additional configuration compared with a typical Ubuntu and Nginx deployment. Developers should test their chosen application server and deployment integration before going live.
11. Installing Wagtail on Virtual Machines and VirtualBox
Virtual machines allow developers to run a complete operating system inside another computer.
This is useful for testing server configurations, practising deployment and preparing production environments.
Popular virtualisation technologies include:
- Oracle VirtualBox.
- VMware Workstation.
- VMware ESXi.
- Microsoft Hyper-V.
- Proxmox VE.
- KVM.
Installation procedure
- Install the preferred virtualisation software.
- Download an Ubuntu or Debian server ISO.
- Create a virtual machine.
- Allocate CPU, RAM and disk resources.
- Install the operating system.
- Configure networking.
- Install Python, PostgreSQL and Nginx.
- Install Wagtail in a virtual environment.
- Configure the application server.
- Test website access through the virtual machine’s network address.
For development, a NAT network is often sufficient.
For testing access from other computers, use bridged networking or an appropriately configured reverse proxy.
A virtual machine can also serve as a staging environment before moving a Wagtail project to a public cloud server.
12. Installing Wagtail on NAS and On-Premises Infrastructure
Some organisations prefer hosting their applications on infrastructure located within their own offices or data centres.
Network Attached Storage (NAS) devices and on-premises servers can provide an environment for running Wagtail, provided they support the necessary software and resources.
Examples of relevant infrastructure include:
- Synology NAS systems.
- QNAP NAS systems.
- Proxmox virtualisation servers.
- Linux-based office servers.
- Private data centre infrastructure.
NAS installation approach
If the NAS supports Docker or another compatible container runtime:
- Enable the container management functionality.
- Create a Wagtail application container.
- Create a PostgreSQL database container or use an external database.
- Configure persistent volumes.
- Configure internal networking.
- Configure reverse proxy access.
- Set up HTTPS.
- Configure off-device backups.
For important production applications, avoid relying exclusively on the NAS for both application hosting and backups. A separate backup destination is advisable.
13. Can Wagtail Run on Serverless Infrastructure?
Wagtail is traditionally deployed as a continuously available Django web application. However, some serverless and function-based environments can run Django applications with suitable adaptations.
Examples include AWS Lambda, Google Cloud Run and other managed container platforms.
There is an important distinction between serverless containers and traditional function-based serverless hosting.
Cloud Run, for example, runs containerised web applications and can accommodate a conventional WSGI application.
Function-based services may require additional integration layers to handle HTTP requests, application startup, database connections and file storage.
Important serverless considerations
- Application startup time.
- Temporary filesystem limitations.
- Database connection management.
- Persistent media storage.
- Background task execution.
- Request execution limits.
- Caching.
- Scheduled maintenance operations.
Wagtail’s database and media files should not depend on the temporary filesystem of a serverless instance.
For most projects, a managed container service is a more straightforward approach than adapting the entire application to individual serverless functions.
14. Configuring Wagtail Static Files and Media Storage
Static files and media files are two important parts of a Wagtail installation.
They serve different purposes and should be configured appropriately.
Static files
Static files include:
- CSS stylesheets.
- JavaScript files.
- Administrative interface assets.
- Fonts.
- Images bundled with the application.
Run:
python manage.py collectstatic
This gathers static assets into the configured static root directory.
In production, these files should be served through Nginx, a CDN or an appropriate object storage arrangement.
Media files
Media files are uploaded through the Wagtail administration interface.
They may include:
- Website photographs.
- Product images.
- PDF documents.
- News illustrations.
- Promotional graphics.
- Editorial attachments.
For a small website, media files can be stored on persistent server storage.
For larger applications, object storage is usually more suitable.
Common options include:
| Storage Platform | Application |
|---|---|
| Amazon S3 | Cloud media storage |
| Google Cloud Storage | Cloud media storage |
| Azure Blob Storage | Enterprise object storage |
| DigitalOcean Spaces | Object storage |
| Backblaze B2 | Cloud backup and media storage |
| Local server storage | Small installations |
When configuring object storage, use a compatible Django storage backend and ensure that upload permissions, file access policies and backup arrangements are properly configured.
15. Setting Up Wagtail for Multiple Websites
Wagtail can support multiple websites through its multi-site functionality.
This is particularly useful for agencies, business groups, directory operators and organisations managing different brands.
For example, an organisation may operate:
- A corporate website.
- A service directory.
- A news website.
- A customer support portal.
- A regional business website.
You can configure multiple Wagtail Site records within one project.
Each site can have its own domain, homepage and content structure.
Installation approach
- Create one Wagtail project.
- Configure the required page models.
- Create individual site records in Wagtail.
- Assign separate hostnames and ports.
- Create appropriate homepages.
- Configure domain DNS.
- Configure Nginx routing.
- Set up appropriate permissions.
- Configure SEO metadata for each site.
- Test each domain independently.
For example:
| Website | Domain | Purpose |
|---|---|---|
| Main corporate website | company.com | Company information |
| Business directory | directory.com | Business listings |
| News portal | news.com | Editorial content |
| Support portal | support.com | Customer information |
Multiple Wagtail sites can share one application and database, but they require careful content permissions, domain configuration and site-specific SEO settings.
For applications that need independent databases, security boundaries or release schedules, separate Wagtail projects may be preferable.
16. Wagtail Deployment Automation and CI/CD
Continuous Integration and Continuous Deployment (CI/CD) help developers automate testing and deployment.
Instead of manually uploading application files whenever changes are made, a CI/CD pipeline can deploy updates from a Git repository.
Common tools include:
- GitHub Actions.
- GitLab CI/CD.
- Jenkins.
- Bitbucket Pipelines.
- Azure DevOps.
- CircleCI.
A typical Wagtail deployment workflow
- Developer updates the website code.
- Changes are committed to Git.
- Automated tests run.
- Dependencies are installed.
- A production container is built.
- The container is uploaded to a registry.
- Database migrations are executed.
- The application is deployed.
- Health checks are performed.
- The previous deployment is retained for rollback where possible.
Example GitHub Actions workflow
name: Wagtail Tests
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Run tests
run: |
python manage.py test
This is a basic testing workflow. A full production deployment pipeline should additionally configure its database, secrets, static files, migrations and hosting platform.
17. Securing a Wagtail CMS Installation
Security is an essential part of hosting Wagtail.
A poorly configured CMS can expose administrator accounts, website data and uploaded documents.
Consider the following security practices:
- Disable Django debug mode in production.
- Use a strong and private Django secret key.
- Configure allowed hosts correctly.
- Enable HTTPS.
- Use strong administrator passwords.
- Limit administrative account permissions.
- Keep Python and Wagtail dependencies updated.
- Restrict database access.
- Use firewall rules.
- Back up databases and uploaded media.
- Monitor server logs.
- Protect credentials using environment variables or secrets management.
- Configure secure cookies and CSRF protection.
- Use rate limiting and appropriate security controls.
- Regularly review administrator accounts.
Run Django’s deployment checks before publishing:
python manage.py check --deploy
Review the output and resolve relevant warnings for your actual production configuration.
18. Common Wagtail Installation Problems and Their Solutions
Even when the installation procedure is straightforward, developers may encounter problems during deployment.
| Problem | Possible Cause | Recommended Solution |
|---|---|---|
| Python installation fails | Unsupported Python version | Install a compatible version |
| Wagtail installation fails | Dependency conflicts | Review package requirements |
| Database connection error | Incorrect credentials | Check PostgreSQL configuration |
| Website returns 502 error | Gunicorn is unavailable | Check application service |
| Static files missing | Incorrect static configuration | Run collectstatic and check Nginx |
| Uploaded images disappear | Temporary storage | Configure persistent media storage |
| Admin dashboard inaccessible | URL or permission issue | Check routing and account permissions |
| Domain does not load | DNS misconfiguration | Verify DNS records |
| HTTPS error | SSL configuration issue | Review certificate and reverse proxy |
| Application crashes | Insufficient resources | Check logs and server capacity |
| Deployment fails | Missing environment variables | Verify deployment configuration |
| Database migrations fail | Schema or permission problems | Review migration history and database privileges |
Useful troubleshooting commands
Check the application service:
sudo systemctl status wagtail
Check Nginx:
sudo systemctl status nginx
View application logs:
sudo journalctl -u wagtail -f
Check PostgreSQL:
sudo systemctl status postgresql
Check available disk space:
df -h
These commands are particularly useful when troubleshooting Linux VPS and dedicated server deployments.
19. Choosing the Best Infrastructure for Wagtail CMS
The best infrastructure depends on your technical skills, website size, budget, traffic and long-term maintenance requirements.
The following table compares common hosting options.
| Infrastructure | Difficulty | Best Application | Main Advantage |
|---|---|---|---|
| Local computer | Easy | Development | Simple installation |
| VirtualBox | Easy to moderate | Testing | Isolated environment |
| Shared Python hosting | Moderate | Small projects | Managed environment |
| VPS | Moderate | Business websites | Flexibility and affordability |
| Dedicated server | Moderate to advanced | Large websites | Dedicated resources |
| Docker | Moderate | Development and production | Portability |
| Managed cloud hosting | Moderate | Business applications | Reduced administration |
| AWS | Advanced | Enterprise websites | Extensive cloud services |
| Google Cloud | Advanced | Scalable applications | Managed infrastructure |
| Microsoft Azure | Advanced | Enterprise applications | Integration with Microsoft services |
| Kubernetes | Advanced | Large platforms | Container orchestration |
| On-premises server | Advanced | Private infrastructure | Greater infrastructure control |
| NAS | Moderate to advanced | Small private installations | Local storage integration |
Which infrastructure should you choose?
For beginners: Start with a local computer and a Python virtual environment.
For small business websites: A Linux VPS with PostgreSQL, Nginx and Gunicorn is a practical starting point.
For developers: Docker provides a convenient and repeatable development environment.
For growing businesses: Consider managed PostgreSQL, object storage and managed application hosting.
For enterprise applications: AWS, Google Cloud, Azure or Kubernetes may provide the flexibility required.
For organisations with private infrastructure: Dedicated servers and virtualisation platforms provide additional control.
20. Maintaining a Wagtail Website After Installation
Installing Wagtail is only the beginning. A production website needs continuous maintenance.
Recommended maintenance activities include:
| Maintenance Activity | Frequency |
|---|---|
| Application backups | Daily |
| Database backups | Daily or according to recovery requirements |
| Security updates | Regularly |
| Dependency reviews | Monthly or during releases |
| Server monitoring | Continuous |
| SSL certificate monitoring | Continuous |
| Website functionality testing | Regularly |
| Database performance checks | Regularly |
| Media storage checks | Monthly |
| Disaster recovery testing | Periodically |
Database backups
PostgreSQL databases can be backed up using:
pg_dump -U wagtailuser -h localhost wagtaildb > wagtail_backup.sql
Restore a backup using an appropriate PostgreSQL restore procedure.
Remember that database backups alone are not sufficient. Uploaded images and documents must also be backed up.
Updating Wagtail
Before updating Wagtail:
- Back up the database.
- Back up uploaded media.
- Review the release notes.
- Check Python and Django compatibility.
- Update dependencies in a test environment.
- Run database migrations.
- Test the administration interface.
- Test website functionality.
- Deploy the updated application.
Avoid blindly upgrading production dependencies without testing.
21. Frequently Asked Questions About Installing Wagtail CMS
1. Can Wagtail CMS be installed on any hosting provider?
Wagtail can run on many hosting platforms, but the provider must support Python applications and the required Django infrastructure. Traditional PHP-only hosting is generally unsuitable.
2. Can I install Wagtail on Windows?
Yes. Wagtail can be installed on Windows using Python and a virtual environment. Windows Server can also host production applications with suitable WSGI and web server configuration.
3. Is Wagtail compatible with Ubuntu?
Yes. Ubuntu is a popular Linux distribution for hosting Wagtail. It supports the Python, PostgreSQL, Nginx and Gunicorn components commonly used in production installations.
4. Can I install Wagtail using cPanel?
Some cPanel environments support Python application hosting. However, support depends on the hosting provider and server configuration. A standard PHP-only cPanel package may not support Wagtail.
5. Does Wagtail require PostgreSQL?
PostgreSQL is a recommended choice for production installations. SQLite can be used for development and testing. Select a database backend supported by your chosen Wagtail release and Django version.
6. Can Wagtail run using Docker?
Yes. Docker can package Wagtail, Python and application dependencies into containers. Docker Compose can also run Wagtail alongside PostgreSQL and other supporting services.
7. Can I host multiple websites using one Wagtail installation?
Yes. Wagtail has multi-site functionality that allows multiple websites to use one project. Separate projects may be preferable where independent deployments and security boundaries are required.
8. Can Wagtail be hosted on AWS?
Yes. Wagtail can run on AWS EC2, container services and other compatible infrastructure. Amazon RDS can provide PostgreSQL, while S3 can store uploaded media.
9. Is Kubernetes necessary for Wagtail?
No. Most small and medium-sized websites can run on a VPS or managed hosting platform. Kubernetes is more appropriate for applications that need complex container orchestration and scaling.
10. Can Wagtail be installed without technical knowledge?
Basic installation is possible by following a step-by-step guide, but production deployment requires knowledge of Python, Django, databases, networking, web servers and security. Professional assistance can help with complex infrastructure configurations.
Conclusion
Wagtail CMS is a flexible content management platform that can operate on many different types of infrastructure. Whether you are developing a small website on a personal computer, hosting a business website on a VPS or deploying an enterprise application across multiple cloud servers, Wagtail provides a strong foundation.
The most straightforward installation method is to use Python, a virtual environment and the Wagtail project creation command. For production, the application should be configured with a suitable database, an application server, a web server, persistent media storage, SSL and reliable backups.
Docker offers portability, managed Python platforms simplify deployment, and cloud infrastructure provides additional flexibility. Kubernetes and dedicated servers are suitable for more demanding environments.
The most important consideration is selecting infrastructure that matches the actual requirements of your website rather than adopting complicated hosting technologies unnecessarily.
With proper installation, security, storage and maintenance, Wagtail can support anything from a simple business website to a sophisticated multi-site content management platform.
Official Wagtail Documentation and Further Reading
- Wagtail official website: https://wagtail.org/
- Wagtail installation documentation: https://docs.wagtail.org/en/stable/getting_started/index.html
- Wagtail deployment and hosting: https://docs.wagtail.org/en/stable/deployment/index.html
- Wagtail deployment technical guide: https://docs.wagtail.org/en/stable/deployment/under_the_hood.html
- Django documentation: https://docs.djangoproject.com/
- Docker documentation: https://docs.docker.com/
- Kubernetes documentation: https://kubernetes.io/docs/
