How to Install ProcessWire on Ubuntu 20.04
ProcessWire is a PHP-based open-source content management system with intuitive features for both developers and end-users. This guide explains how to install ProcessWire on Ubuntu 20.04 LTS VPS with a LAMP stack.
Requirements
ProcessWire must be installed on a LAMP server. Follow these steps before you begin.
- Deploy an Ubuntu 20.04 LTS Vultr cloud server instance.
- Update your server.
- Create a non-root sudo account.
- Install a LAMP stack.
Optionally, you could deploy a Vultr One-Click LAMP server.
1. Configure Apache
- Log in to your server as a non-root user with sudo access.
- ProcessWire requires the Apache
mod_rewritemodule. To enable the module, use thea2enmodutility, then restart Apache.$ sudo a2enmod rewrite $ sudo systemctl restart apache2 - Edit the default Apache host configuration.
$ sudo nano /etc/apache2/sites-enabled/000-default.conf - Verify the
DocumentRootdirective points to/var/www/html. - Paste the following block before the final
</VirtualHost>statement.<Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all Require all granted </Directory>The file should look like this after you finish.
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all Require all granted </Directory> </VirtualHost> - Save and exit the file.
- Use the
systemctlcommand to start Apache automatically when the server restarts.$ sudo systemctl enable apache2 - Start the Apache web server.
$ sudo systemctl start apache2
2. Create the ProcessWire Database
- Log in to MySQL as root.
$ sudo mysql -u root -p - Create the ProcessWire database and user. Replace
your_secure_passwordin the example below with a strong password.mysql> CREATE USER 'processwire_user'@'localhost' IDENTIFIED BY 'your_secure_password'; mysql> CREATE DATABASE processwire_db; mysql> GRANT ALL PRIVILEGES ON processwire_db.* TO 'processwire_user'@'localhost'; mysql> FLUSH PRIVILEGES; - Exit MySQL.
mysql> QUIT;
3. Install ProcessWire
- Change to your web root directory:
$ cd /var/www/html - Remove the
index.htmlfile.$ sudo rm index.html - Launch your browser and navigate to the ProcessWire download page:
- Copy the download link for the ProcessWire Master version.
- Return to your terminal session and download the installation package.
$ sudo wget https://github.com/processwire/processwire/archive/master.zip - Install unzip, which is required to extract the installation package.
$ sudo apt install unzip -y - Extract the ProcessWire installation package.
$ sudo unzip master.zip - Move the files to the web root folder and clean up the temporary files.
$ sudo mv processwire-master/* /var/www/html $ sudo rm -rf processwire-master/ $ sudo rm master.zip - Change the file ownership to the
www-datauser.$ sudo chown -R www-data:www-data * . - Restart Apache.
$ sudo systemctl restart apache2 - Open your browser and navigate to the server’s IP address, for example:
http://192.0.2.123 - Click
Get Startedto begin. - Choose an installation profile and click
Continue. - Verify all compatibility checks succeed, then click Continue To Next Step.
- Enter the MySQL database information.
- DB Name: processwire_db
- DB User: processwire_user
- DB Pass: your_secure_password
- DB Host: localhost
- DB Port: 3306
- DB Charset: utf-8
- DB Engine: MyISAM
- Select your time zone.
- Leave file permissions at the default of
755for directories and644for files. - If you have a DNS hostname, enter it in the hostname section. You can enter multiple names, one host per line. Otherwise, leave the IP address as the hostname.
- Set Debug Mode to
Disabledfor production. Development servers should enable debug mode. - Click
Continueto proceed. - Leave the admin login URL at the default value,
processwire. - Enter your admin username, password, and email address.
- Leave the Cleanup options checked, and click Continue.
- Click Login To Admin to begin using ProcessWire.
(Optional) Configure the Firewall
Enable the firewall and allow HTTP (TCP port 80) and SSH (TCP port 22).
$ sudo ufw allow 80/tcp
$ sudo ufw allow 22/tcp
$ sudo ufw enable