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.
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-addressReplace 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 -yThis 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 -yAfter installation, enable the Apache rewrite module (required for OJS clean URLs):
sudo a2enmod rewriteEnable Apache to start on server reboot:
sudo systemctl enable apache2Start Apache:
sudo systemctl start apache2Verify Apache is running:
sudo systemctl status apache2You 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 -yInstall 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 -yEnable PHP Apache module:
sudo a2enmod php8.1Restart Apache to load the PHP module:
sudo systemctl restart apache2Verify PHP is working:
php -vYou should see PHP 8.1.x version information.
Step 5: Install and Configure MySQL
Install MySQL server:
sudo apt install mysql-server -ySecure your MySQL installation:
sudo mysql_secure_installationFollow 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 mysqlStep 6: Create an OJS Database and Database User
Connect to MySQL:
sudo mysql -u rootYou 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.iniFind 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.logSave and exit (Ctrl+X, then Y, then Enter).
Restart Apache to apply the changes:
sudo systemctl restart apache2Step 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_filesSet ownership to the Apache user:
sudo chown -R www-data:www-data /var/ojs_filesSet permissions:
sudo chmod -R 775 /var/ojs_filesNote 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.confPaste 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.confTest Apache configuration:
sudo apache2ctl configtestYou should see Syntax OK.
Restart Apache:
sudo systemctl restart apache2Step 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 -yGet an SSL certificate (replace with your domain):
sudo certbot --apache -d yourjournal.com -d www.yourjournal.comCertbot will ask a few questions. When asked to redirect HTTP to HTTPS, answer Yes.
Verify the certificate:
sudo certbot certificatesSet up automatic renewal:
sudo systemctl enable certbot.timerStep 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/ojsStep 13: Access the OJS Installation Wizard
Open your browser and navigate to your domain:
https://yourjournal.comYou 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.logStep 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 apache2Configure 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.shPaste:
#!/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 -deleteMake it executable:
sudo chmod +x /usr/local/bin/backup-ojs.shSchedule daily backups:
sudo crontab -eAdd this line:
0 2 * * * /usr/local/bin/backup-ojs.shThis 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/tcpDisable root login:
sudo nano /etc/ssh/sshd_configFind PermitRootLogin and change to:
PermitRootLogin noRestart SSH:
sudo systemctl restart sshCommon 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.logCheck 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_filesProblem: 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:
- Connect via SSH
- Update system packages
- Install Apache
- Install PHP and extensions
- Install MySQL
- Create database and user
- Configure PHP settings
- Create files directory
- Configure Apache virtual host
- Set up SSL certificate
- Download and upload OJS
- Set file permissions
- Access installation wizard
- Complete installation
- Configure post-installation settings
- 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.
