how to install processwire cms on ubuntu 22.04

How to Install ProcessWire CMS on Ubuntu 22.04

Spread the love

In this tutorial, we will show you how to install ProcessWire CMS on Ubuntu 22.04 OS.

ProcessWire is a free, open-source content management system written in PHP. It offers many features such as jQuery-styled API, scaling, templates, multi languages, drag-and-drop page lists, and many more that are largely used for developing websites and applications. ProcessWire stores the data in the MySQL database server, and in this installation, we will install the ProcessWire CMS with the LAMP stack.

Installing ProcessWire CMS on Ubuntu 22.04 with LAMP stack is a straightforward process that may take up to 15 minutes. Let’s get things done!

Prerequisites

  • A server with Ubuntu 22.04 OS
  • A valid domain with pointed A record to the server IP address
  • User privileges: root or non-root user with sudo privileges

Step 1. Update the System

It is recommended to have a fresh installation of Ubuntu 22.04 for this setup. After every fresh installation of the OS, we need to update the system packages to the latest versions available.

sudo apt update -y && sudo apt upgrade -y

Step 2. Install Apache Web Server

To install the Apache Web server execute the following command:

sudo apt install apache2

Once installed, start and enable the service.

sudo systemctl enable apache2 && sudo systemctl start apache2

Check if the service is up and running:

sudo systemctl status apache2

You should receive the following output:

root@host:~# sudo systemctl status apache2
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-05-04 11:02:35 CDT; 4min 53s ago
       Docs: https://httpd.apache.org/docs/2.4/
   Main PID: 446641 (apache2)
      Tasks: 6 (limit: 4571)
     Memory: 16.8M
        CPU: 558ms
     CGroup: /system.slice/apache2.service

Step 3. Install PHP8 with dependencies

To install the PHP8.1 along with extensions, execute the following command:

sudo apt-get install php8.1 php8.1-cli php8.1-common php8.1-imap php8.1-redis php8.1-snmp php8.1-xml php8.1-zip php8.1-mbstring php8.1-curl libapache2-mod-php

To check the installed PHP version, execute the following command:

php -v

You should receive the following output:

root@host:~# php -v
PHP 8.1.2-1ubuntu2.11 (cli) (built: Feb 22 2023 22:56:18) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2-1ubuntu2.11, Copyright (c), by Zend Technologies

Step 4. Install the MariaDB database server

To install the MariaDB database server, execute the command below.

sudo apt install mariadb-server

Start and enable the mariadb.service with the following commands:

sudo systemctl start mariadb && sudo systemctl enable mariadb

Check the status of the mariadb.service

sudo systemctl status mariadb

You should receive the following output:

root@host:~# sudo systemctl status mariadb
● mariadb.service - MariaDB 10.6.12 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-05-04 11:06:40 CDT; 5min ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 458296 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 458297 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 458299 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl >
    Process: 458481 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 458485 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
   Main PID: 458336 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 11 (limit: 4571)

Step 5. Create ProcessWire database and user

Next, we need to create a ProcessWire database, the ProcessWire user, and grant the permissions for that user to the database.

 CREATE USER 'processwire'@'localhost' IDENTIFIED BY 'YourStrongPasswordHere';
 CREATE DATABASE processwire;
 GRANT ALL PRIVILEGES ON processwire.* TO 'processwire'@'localhost';
 FLUSH PRIVILEGES;
 EXIT;

Step 6. Download and Install ProcessWire

Before we install ProcessWire, we first need to download it in the default Apache document root:

cd /var/www/html

wget https://github.com/processwire/processwire/archive/master.zip

unzip master.zip

mv processwire-master/ processwire/

Set the right permissions to files and folders.

chown -R www-data:www-data processwire/

find . -type d -exec chmod 755 {} \;

find . -type f -exec chmod 644 {} \;

Step 7. Create Apache Virtual Host File

Go into the Apache directory and create a configuration file for the ProcessWire CMS.

cd /etc/apache2/sites-available/

touch processwire.conf

Open the file, paste the following lines of code, save the file and close it.

<VirtualHost *:80>
ServerName yourdomain.com
DocumentRoot /var/www/html/processwire

<Directory /var/www/html/processwire>
AllowOverride All
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Enable the Apache configuration for ProcessWire and rewrite module.

sudo a2enmod rewrite

sudo a2ensite processwire.conf

Check the syntax:

apachectl -t

You should receive the following output:

root@vps:~# apachectl -t
Syntax OK

If the syntax is OK, restart the Apache service.

systemctl reload apache2

Once the Apache service is restarted, you can finish the ProcessWire installation at http://yourdomain.com

Step 8. Finish ProcessWire installation

On the first window, click Get Started

On the next window, choose Blank

The third window is for configuration check:

Next, is to fill in the database credentials you set in Step 5

After successful database credentials, hit Continue, and you should see the following screen:

Scroll down and enter your admin credentials for future use:

Once done, the installation process will finish, and you will be able to login to the Admin dashboard

That was all. You successfully installed and configured ProcessWire CMS on Ubuntu 22.04 with the LAMP stack.

If you do not want to configure it on your own, you can sign up for one of our NVMe VPS plans and submit a support ticket. Our admins are available 24/7 and will start work on your request immediately. Always trust our epic support.

If you liked this post on installing ProcessWire CMS on Ubuntu 22.04, please share it with your friends on social networks or simply leave a reply below. Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *