Local installation of Open Journal Systems (OJS) with DDEV

I just started with OJS and I want to share how I installed it locally on my computer

Like some know DDEV is an open source tool for launching local web development environments. DDEV by default install Drupal sites, Wordpress, Typo3 and Laravel (and other cms projects) but OJS is not in the list.

To get a local installation follow this steps:

1-Get OJS 3.4 program for the pkp site.
2-Locally create a directory and get there all OJS files, this is the directory where you will run the ddev project.
Actually go inside it using terminal

3- Follow the DDEV instructions to begin with a PHP project

3.1 Write the command: ddev config to begin the project. DDEV will give you the kind of project you can begin with it.
Choose (write) PHP. DDev will ask for another information like project name etc. DDEV begin downloading and creating docker images to run the project.
3.2 Type the command: CD .ddev to go inside the ddev project folder.
Then type the command: nano config.yaml (or vim or the editor you like to use) to change the configuration of project.
3.3 You need to change the php, web server and database the project use, to get the closer you can, to OJS requirements. This is the configuration I use:

`name: ojs 
type: php
docroot: ""
php_version: "8.0"
webserver_type: apache-fpm
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
database:
    type: postgres
    version: "10"`

Check your configuration very carefully before copying this config. The most important part is to get a php 8.0, apache-fpm and postgres 10.

do the change and save configuration file.
Return to main directory (where you copy ojs files)

Dont modify any other information insde conf file.

4- Type the command: ddev start to run DDEV. If all the configuration change are correct you will get a OJS ready to install.
Type the command: ddev launch to open the browser and get the OJS installation page.

5- The OJS installation page will ask for all the information require to install, like a username and a password and database information.
The basic problem I get to install OJS was to get all the requirements needed, many of the version of database OJS ask for are old. I try but cant install the program with mysql, but I get a installation with postgress.
It is important to get database information to not get frustrated. The fast answer is DDEV create a database with name DB a user DB with a password DB and dont write localhost to find the database, type DB, really easy dont? if you want to know more about what DDEV is running just type the command: ddev describe to get all the information of the project.
After all this configuration you will get a OJS site to test local.

Additional information
originally posted this article in dev.to.

3 Likes

Nice howto.

I’m curious. Why you didn’t use the official docker images?
https://hub.docker.com/r/pkpofficial/ojs

Cheers,
m.

1 Like

I’m new to OJS and I didn’t know that docker image existed, thanks for the information! Anyway, I wanted to share that way to install OJS. I use DDEV a lot with Drupal and I wanted to see how to install it as a PHP project.

2 Likes

Yes. This is a nice howto. Thanks for sharing.
Please, share your experience with the official images, so we can improve it.

May I go with an “out of topic”?
I don’t use DDEV but I also host drupals in our service.
What image do you use? What volumes do you create?

I’m using my own images because I never found official drupal images and the ones I found are more though for developers… but in production drupal I always had problems with the sync between code (in the container updated with compose) and database (that is a persistent volume).

Any good practices about how to use drupal in production with containers?

Thanks for sharing,
m.

Hi Marc, to be honest I only use docker locally with ddev. Maybe you could install ddev and see what image versions it uses for each thing (nginx, apache, php, mariadb, etc).

1 Like