install OJS VPS is what this guide covers, with the exact checks and fixes journals hit in production. More OJS help: Open Journal Systems guides.
install OJS VPS
You Have a VPS. Now You Have Full Control, and Full Responsibility.
Direct answer: Install OJS on Ubuntu VPS by hardening the LAMP stack yourself: SSH in, apt update, install Apache + rewrite, PHP 8.1 with OJS extensions, MySQL DB/user, tune upload/memory limits, create /var/ojs_files outside the web root, add a vhost for /var/www/ojs, enable Let's Encrypt HTTPS, deploy OJS with www-data ownership, finish the web installer, then add SMTP, backups, and UFW.
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).
How to Install OJS on a VPS (Install Path)
Follow this path on a bare Ubuntu server. Exact apt commands, virtual host, SSL, and troubleshooting examples are in the numbered steps below.
- SSH to the VPS as a sudo user; confirm Ubuntu 20.04/22.04 and DNS A/AAAA records point at the server IP.
- Run apt update && apt upgrade, then install Apache and enable rewrite + boot-time startup.
- Install PHP 8.1 (or supported) and OJS extensions; enable php module and restart Apache; verify php -v.
- Install MySQL, run mysql_secure_installation, create ojs database/user with full privileges.
- Tune php.ini (upload/post size, execution time, memory) and create /var/ojs_files owned by www-data:www-data 775.
- Create Apache vhost with DocumentRoot /var/www/ojs, AllowOverride All, enable site, configtest, restart.
- Issue Let’s Encrypt certificate with certbot --apache and force HTTP→HTTPS redirect.
- Deploy extracted OJS files to /var/www/ojs via scp/sftp; set dirs 755, files 644, chown www-data.
- Open https://yourdomain, complete install wizard (localhost DB, /var/ojs_files, HTTPS base_url, admin).
- Post-install: SMTP, daily backups, UFW + SSH hardening; retest logs if blank page, DB, or upload errors appear.
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
Frequently Asked Questions
How do I install OJS on a VPS or Ubuntu server?
SSH into Ubuntu 20.04/22.04, update packages, install Apache with rewrite, PHP 8.1 plus OJS extensions, and MySQL. Create a DB/user and /var/ojs_files owned by www-data, configure a virtual host, issue Let’s Encrypt SSL, deploy OJS under /var/www/ojs with correct permissions, complete the web installer with live HTTPS base_url, then set SMTP, backups, and UFW.
Which PHP extensions does OJS need on Ubuntu?
Typical stack: php8.1 (or current supported) with mysql, mbstring, xml, curl, zip, gd, intl, and opcache. Tune php.ini for upload_max_filesize, post_max_size, max_execution_time, and memory_limit so submissions and installs do not fail.
Where should files_dir be on a VPS?
Outside the web root—commonly /var/ojs_files—owned by www-data with 775. Point that absolute path on the installer’s Files page so submission galleys are not public under DocumentRoot.
Why is the OJS install wizard blank on Ubuntu?
Usually a missing PHP extension, PHP fatal error, wrong DocumentRoot, or missing AllowOverride/rewrite. Check /var/log/apache2/ojs_error.log and PHP error log, install missing modules, enable a2enmod rewrite and php, then restart Apache.
Is SSL required when installing OJS on a VPS?
Yes for production. Use Certbot/Let’s Encrypt on Apache, set force HTTPS and base_url to https://yourdomain, and open UFW ports 80/443 (plus 22 for SSH). HTTPS fails silently break cookies, DOIs, and installs if base_url stays http.
What security steps should follow a VPS OJS install?
UFW allow only 22/80/443, disable root SSH login when possible, configure SMTP (not bare PHP mail), schedule daily mysqldump plus files/www backups, keep packages updated, and never leave default weak admin credentials.
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.
