Automad is an open source file-based content management system (CMS) and template engine written in PHP. The Automad source code is hosted on GitHub. This guide will show you how to install Automad CMS on Ubuntu 18.04 Rcs instance.
Requirements
- PHP version 5.4 or greater.
- Web server software. In this guide, we use Nginx.
Before you begin
Check the Ubuntu version.
lsb_release -ds
# Ubuntu 18.04.2 LTSCreate a new non-root user account with sudo access and switch to it.
adduser johndoe --gecos "John Doe"
usermod -aG sudo johndoe
su - johndoeNOTE: Replace johndoe with your username.
Set up the timezone.
sudo dpkg-reconfigure tzdataEnsure that your system is up to date.
sudo apt update && sudo apt upgrade -yInstall the needed packages.
sudo apt install -y zip unzip curl wget gitInstall PHP
Install PHP, as well as the necessary PHP extensions.
sudo apt install -y php7.2 php7.2-cli php7.2-fpm php7.2-common php7.2-mbstring php7.2-xmlrpc php7.2-soap php7.2-gd php7.2-xml php7.2-curl php7.2-zipCheck the version.
php --version
# PHP 7.2.19-0ubuntu0.18.04.1 (cli) (built: Jun 4 2019 14:48:12) ( NTS )
# Copyright (c) 1997-2018 The PHP Group
# Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
# with Zend OPcache v7.2.19-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend TechnologiesInstall Nginx
Install Nginx.
sudo apt install -y nginxCheck the version.
sudo nginx -v
# nginx version: nginx/1.14.0 (Ubuntu)Run sudo vim /etc/nginx/sites-available/automad.conf and populate the file with the following configuration.
server {
listen 80;
server_name example.com;
root /var/www/automad;
index index.php index.html;
client_max_body_size 100M;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}Activate the new automad.conf configuration by linking the file to the sites-enabled directory.
sudo ln -s /etc/nginx/sites-available/automad.conf /etc/nginx/sites-enabled/Test the configuration.
sudo nginx -tReload Nginx.
sudo systemctl reload nginx.serviceInstall Automad
Create a document root directory.
sudo mkdir -p /var/www/automadChange ownership of the /var/www/automad directory to johndoe.
sudo chown -R johndoe:johndoe /var/www/automadNavigate to the document root.
cd /var/www/automadUsing curl download the latest release of Automad CMS. Don't forget to bump up the version numbers if there is a newer release.
curl -O -J -L https://automad.org/downloadUncompress the zip archive.
unzip marcantondahmen-automad-6fff2a0456dc.zipMove all Automad files to the document root and remove zip archive.
mv marcantondahmen-automad-6fff2a0456dc/* . && mv marcantondahmen-automad-6fff2a0456dc/.* .
rm marcantondahmen-automad-6fff2a0456dc.zip
rmdir marcantondahmen-automad-6fff2a0456dcChange ownership of the /var/www/automad directory to www-data.
sudo chown -R www-data:www-data /var/www/automadAs the last step, create a user account to use the browser-based user interface called the Dashboard. Therefore navigate to https://yoursite.com/dashboard and follow the instructions.