You Have a VPS. Now You Have Full Control, and Full Responsibility.

A VPS or dedicated Ubuntu server gives you complete control over your OJS environment. No shared hosting limitations. No cPanel restrictions. No waiting for hosting support to enable PHP extensions. You can optimize every setting, install exactly what you need, and configure your journal exactly as it should be.

SponsoredNeed OJS hosting that scales?

Managed OJS hosting with backups, SSL, and priority support for scholarly publishers.

See pricing plans →

But that control comes with responsibility. Unlike cPanel hosting where most configurations are pre-built, a VPS requires you to install and configure your web server, database server, PHP, and all dependencies from scratch. One misconfiguration, a missing PHP extension, incorrect file permissions, a web server rewrite rule that blocks OJS, breaks your installation silently.

Many editors who move from cPanel to a VPS encounter problems they never faced before, not because VPS hosting is worse, but because more is being configured and more can go wrong if the configuration is not correct.

This guide walks you through a complete OJS installation on Ubuntu VPS from bare server to fully functional journal, including web server installation, PHP configuration, database setup, and post-installation hardening, written by OJS specialists who have installed OJS on hundreds of VPS servers.

If you want an expert to handle your complete VPS OJS setup, visit ojsguru.com for a free consultation.

Prerequisites, What You Need to Start

Before beginning, you need:

1. A VPS or dedicated server running Ubuntu 20.04 LTS or 22.04 LTS Other Linux distributions work but Ubuntu is most common and best documented for OJS.

2. SSH access to your server You will receive SSH credentials (hostname, username, password, or SSH key) from your VPS provider.

3. A registered domain name pointing to your server's IP address Your domain's DNS records should point to your VPS IP address.

4. Basic command-line familiarity You will be using the terminal to install software and configure settings. No advanced knowledge needed, this guide provides exact commands to run.

5. Root or sudo access Your user account must be able to run commands with sudo (superuser do).

Step 1: Connect to Your VPS via SSH

Open a terminal on your computer and connect to your VPS:

ssh username@your-vps-ip-address

Replace username with your VPS username and your-vps-ip-address with the IP address provided by your hosting provider.

Enter your password when prompted (or use your SSH key if configured).

You should see a command prompt:

username@server-name:~$

You are now connected to your VPS.

Step 2: Update System Packages

The first time you connect, update all system packages to the latest versions:

sudo apt update
sudo apt upgrade -y

This takes a few minutes and ensures your server has the latest security patches and software.

Step 3: Install Apache Web Server

OJS requires a web server to serve your journal to visitors. Apache is the most widely used and compatible option.

sudo apt install apache2 -y

After installation, enable the Apache rewrite module (required for OJS clean URLs):

sudo a2enmod rewrite

Enable Apache to start on server reboot:

sudo systemctl enable apache2

Start Apache:

sudo systemctl start apache2

Verify Apache is running:

sudo systemctl status apache2

You should see active (running) in the output.

Step 4: Install PHP and Required Extensions

OJS 3.x requires PHP 7.3 or higher. Install PHP 8.1 (compatible and modern):

sudo apt install php8.1 php8.1-cli php8.1-fpm -y

Install the required PHP extensions for OJS:

sudo apt install \
  php8.1-mysql \
  php8.1-mbstring \
  php8.1-xml \
  php8.1-curl \
  php8.1-zip \
  php8.1-gd \
  php8.1-intl \
  php8.1-json \
  php8.1-opcache -y

Enable PHP Apache module:

sudo a2enmod php8.1

Restart Apache to load the PHP module:

sudo systemctl restart apache2

Verify PHP is working:

php -v

You should see PHP 8.1.x version information.

Step 5: Install and Configure MySQL

Install MySQL server:

sudo apt install mysql-server -y

Secure your MySQL installation:

sudo mysql_secure_installation

Follow the prompts. When asked "Remove anonymous users?" answer Y. For all other prompts, answer Y to harden security.

Start MySQL:

sudo systemctl start mysql
sudo systemctl enable mysql

Step 6: Create an OJS Database and Database User

Connect to MySQL:

sudo mysql -u root

You are now in the MySQL command prompt. Create a database for OJS:

CREATE DATABASE ojs_journal;

Create a database user with a strong password (replace secure_password with your own):

CREATE USER 'ojs_user'@'localhost' IDENTIFIED BY 'secure_password';

Grant the user full privileges on the OJS database:

GRANT ALL PRIVILEGES ON ojs_journal.* TO 'ojs_user'@'localhost';
FLUSH PRIVILEGES;

Exit MySQL:

EXIT;

Write down:

  • Database name: ojs_journal
  • Database user: ojs_user
  • Database password: secure_password (the one you chose)

You will need these during OJS installation.

Step 7: Configure PHP Settings for OJS

OJS requires specific PHP configuration settings. Edit the PHP configuration file:

sudo nano /etc/php/8.1/apache2/php.ini

Find and update these settings (use Ctrl+W to search):

upload_max_filesize = 50M
post_max_size = 55M
max_execution_time = 300
max_input_time = 300
memory_limit = 256M
display_errors = Off
log_errors = On
error_log = /var/log/php_errors.log

Save and exit (Ctrl+X, then Y, then Enter).

Restart Apache to apply the changes:

sudo systemctl restart apache2

Step 8: Create an OJS Files Directory

OJS stores uploaded files (submissions, galleys, etc.) in a files directory outside the web root for security.

Create the directory:

sudo mkdir -p /var/ojs_files

Set ownership to the Apache user:

sudo chown -R www-data:www-data /var/ojs_files

Set permissions:

sudo chmod -R 775 /var/ojs_files

Note the full path: /var/ojs_files, you will need this during installation.

Step 9: Configure Apache Virtual Host for OJS

Create an Apache configuration file for your domain:

sudo nano /etc/apache2/sites-available/yourjournal.com.conf

Paste this configuration (replace yourjournal.com with your actual domain):


    ServerName yourjournal.com
    ServerAlias www.yourjournal.com
    ServerAdmin admin@yourjournal.com
    DocumentRoot /var/www/ojs

    
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    

    ErrorLog ${APACHE_LOG_DIR}/ojs_error.log
    CustomLog ${APACHE_LOG_DIR}/ojs_access.log combined

Save and exit.

Enable the site:

sudo a2ensite yourjournal.com.conf

Test Apache configuration:

sudo apache2ctl configtest

You should see Syntax OK.

Restart Apache:

sudo systemctl restart apache2

Step 10: Set Up an SSL Certificate (HTTPS)

Modern websites require HTTPS. Use Let's Encrypt for a free SSL certificate:

Install Certbot:

sudo apt install certbot python3-certbot-apache -y

Get an SSL certificate (replace with your domain):

sudo certbot --apache -d yourjournal.com -d www.yourjournal.com

Certbot will ask a few questions. When asked to redirect HTTP to HTTPS, answer Yes.

Verify the certificate:

sudo certbot certificates

Set up automatic renewal:

sudo systemctl enable certbot.timer

Step 11: Download and Upload OJS

Download OJS on your local computer from pkp.sfu.ca/ojs/download/

Extract the tar.gz file.

Upload the OJS files to your server using SCP (Secure Copy):

scp -r ojs-3.4.0-18/* username@your-vps-ip:/var/www/ojs/

Or use an SFTP client like FileZilla to upload the files to /var/www/ojs/.

After upload, verify files are in place:

ls -la /var/www/ojs/

You should see index.php, config.TEMPLATE.inc.php, and other OJS files.

Step 12: Set File Permissions

Set correct permissions for all OJS files:

# Directories: 755
sudo find /var/www/ojs -type d -exec chmod 755 {} \;

# Files: 644
sudo find /var/www/ojs -type f -exec chmod 644 {} \;

# Web server ownership
sudo chown -R www-data:www-data /var/www/ojs

Step 13: Access the OJS Installation Wizard

Open your browser and navigate to your domain:

https://yourjournal.com

You should see the OJS Installation Wizard.

If you see an error, check:

  • Apache virtual host is configured correctly
  • DNS is pointing to your server IP
  • SSL certificate is installed
  • OJS files are in /var/www/ojs/
  • File permissions are set to 755 for directories

Check Apache error log for issues:

sudo tail -50 /var/log/apache2/ojs_error.log

Step 14: Complete the Installation Wizard

The Installation Wizard guides you through configuration. Work through each page:

Page 1, Language and Database

  • Database driver: MySQL
  • Database host: localhost
  • Database name: ojs_journal
  • Database user: ojs_user
  • Database password: (the password you created)
  • Create tables: Yes

Page 2, File Configuration

  • Files directory: /var/ojs_files
  • Public files directory: (leave default)

Page 3, Site Configuration

  • Base URL: https://yourjournal.com
  • Force HTTPS: Yes
  • Off-site database: No

Page 4, Administrator Account

  • Create your admin account with strong credentials

Click through to complete installation.

Step 15: Post-Installation Configuration

After installation, configure your journal:

Enable mod_rewrite for clean URLs (likely already enabled but verify):

sudo a2enmod rewrite
sudo systemctl restart apache2

Configure SMTP for email (critical for OJS):

OJS uses PHP mail() by default which often fails on VPS. Go to OJS Settings → Distribution → Email and configure SMTP with Gmail, SendGrid, or your email provider.

Set up backups:

Create a backup script:

sudo nano /usr/local/bin/backup-ojs.sh

Paste:

#!/bin/bash
DATE=$(date +%Y%m%d)
BACKUP_DIR="/backups"
mkdir -p $BACKUP_DIR

# Backup database
mysqldump -u ojs_user -p'secure_password' ojs_journal > $BACKUP_DIR/ojs_db_$DATE.sql

# Backup files
tar -czf $BACKUP_DIR/ojs_files_$DATE.tar.gz /var/ojs_files
tar -czf $BACKUP_DIR/ojs_www_$DATE.tar.gz /var/www/ojs

# Keep only last 30 days
find $BACKUP_DIR -type f -mtime +30 -delete

Make it executable:

sudo chmod +x /usr/local/bin/backup-ojs.sh

Schedule daily backups:

sudo crontab -e

Add this line:

0 2 * * * /usr/local/bin/backup-ojs.sh

This runs backups daily at 2:00 AM.

Step 16: Secure Your VPS

Configure firewall:

sudo ufw enable
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

Disable root login:

sudo nano /etc/ssh/sshd_config

Find PermitRootLogin and change to:

PermitRootLogin no

Restart SSH:

sudo systemctl restart ssh

Common VPS OJS Installation Problems

Problem: Installation wizard shows blank page

Cause: PHP errors or missing extensions.

Solution:

sudo tail -50 /var/log/apache2/ojs_error.log
sudo tail -50 /var/log/php_errors.log

Check the error messages and install any missing extensions.

Problem: "Cannot connect to database"

Cause: Database credentials wrong or MySQL not running.

Solution:

sudo systemctl status mysql
sudo mysql -u ojs_user -p -e "USE ojs_journal; SHOW TABLES;"

Test the credentials manually.

Problem: File upload fails

Cause: Files directory not writable.

Solution:

sudo chown -R www-data:www-data /var/ojs_files
sudo chmod -R 775 /var/ojs_files

Problem: Email not sending

Cause: PHP mail() not configured or SMTP credentials wrong.

Solution: Go to OJS Settings and configure SMTP with your email provider's settings.

When to Call in a Professional

VPS installation is complex with many moving parts. Consider professional help when:

  • You are not comfortable with command-line administration
  • Installation fails and you cannot diagnose from error logs
  • You want to ensure your VPS is configured securely from the start
  • You need production-grade backups and disaster recovery
  • You want to avoid mistakes that could compromise your journal's data

OJS Guru handles complete VPS OJS installations, from server configuration through production hardening, with backups and monitoring set up correctly.

👉 Get a free consultation at ojsguru.com

Summary

Installing OJS on a VPS requires installing and configuring multiple services, Apache, PHP, MySQL, and OJS itself, but gives you complete control over your environment. The 16 steps covered in this guide take you from bare VPS to fully functional journal:

  1. Connect via SSH
  2. Update system packages
  3. Install Apache
  4. Install PHP and extensions
  5. Install MySQL
  6. Create database and user
  7. Configure PHP settings
  8. Create files directory
  9. Configure Apache virtual host
  10. Set up SSL certificate
  11. Download and upload OJS
  12. Set file permissions
  13. Access installation wizard
  14. Complete installation
  15. Configure post-installation settings
  16. Secure your VPS

Done correctly, your VPS will provide superior performance, control, and reliability compared to shared hosting.

If you want an expert to handle your complete VPS OJS setup, contact OJS Guru at ojsguru.com. We configure VPS OJS installations regularly and we'll ensure yours is production-ready from day one.

OJS Guru is a professional Open Journal Systems service provider specializing in OJS installation, customization, migration, and technical support for research journal publishers in 20+ countries. Visit ojsguru.com to request a free consultation.