DSpace Installation

DSpace 8.0 · Ubuntu 24.04 LTS

Overview

DSpace is an open-source platform for institutional repositories and managing and preserving digital scholarly outputs.

Version-specific referenceThese commands are retained as historical instructions for the stated versions. Validate them against current official guidance before using them on production systems. Source: Original tutorial
01Prepare Ubuntu
sudo apt update && sudo apt upgrade -y

Refreshes the local package index using configured repositories.

sudo useradd -m dspace

Runs the original operation with administrator privileges; confirm paths and version requirements.

sudo passwd dspace

Runs the original operation with administrator privileges; confirm paths and version requirements.

sudo usermod -aG sudo dspace

Runs the original operation with administrator privileges; confirm paths and version requirements.

sudo mkdir /dspace

Creates the specified directory.

sudo chown dspace /dspace

Changes file ownership; check the destination path and user.

sudo apt install wget curl git build-essential mousepad zip unzip -y

Installs the named packages and their dependencies.

02Install Java and Tools
sudo apt install openjdk-17-jdk -y

Installs the named packages and their dependencies.

sudo mousepad /etc/environment

Opens a file in an editor for manual configuration.

JAVA_HOME=”/usr/lib/jvm/java-17-openjdk-amd64”

Original installation command or configuration value. Follow the surrounding steps for correct context.

JAVA_OPTS=”-Xmx512M -Xms64M -Dfile.encoding=UTF-8”

Original installation command or configuration value. Follow the surrounding steps for correct context.

source /etc/environment

Original installation command or configuration value. Follow the surrounding steps for correct context.

echo $JAVA_HOME

Original installation command or configuration value. Follow the surrounding steps for correct context.

echo $JAVA_OPTS

Original installation command or configuration value. Follow the surrounding steps for correct context.

sudo apt install maven ant -y

Installs the named packages and their dependencies.

03Configure PostgreSQL
sudo apt-get install postgresql postgresql-client postgresql-contrib libpostgresql-jdbc-java -y

Installs the named packages and their dependencies.

psql -V psql

Original installation command or configuration value. Follow the surrounding steps for correct context.

sudo pg_ctlcluster 16 main start

Runs the original operation with administrator privileges; confirm paths and version requirements.

sudo systemctl status postgresql

Manages or checks a system service.

sudo passwd postgres

Runs the original operation with administrator privileges; confirm paths and version requirements.

su postgres

Original installation command or configuration value. Follow the surrounding steps for correct context.

exit

Original installation command or configuration value. Follow the surrounding steps for correct context.

sudo mousepad /etc/postgresql/16/main/postgresql.conf

Opens a file in an editor for manual configuration.

listen_addresses = 'localhost'

Original installation command or configuration value. Follow the surrounding steps for correct context.

sudo mousepad /etc/postgresql/16/main/pg_hba.conf

Opens a file in an editor for manual configuration.

#DSpace configuration
host dspace dspace 127.0.0.1 255.255.255.255 md5

Multi-line source text. Follow the original context: not every block is a standalone shell command.

sudo systemctl restart postgresql

Manages or checks a system service.

04Install Apache Solr
cd

Original installation command or configuration value. Follow the surrounding steps for correct context.

sudo wget https://downloads.apache.org/lucene/solr/8.11.4/solr-8.11.4.zip

Downloads a file or resource from a remote source; verify the URL and authenticity.

sudo unzip solr-8.11.4.zip

Runs the original operation with administrator privileges; confirm paths and version requirements.

sudo bash solr-8.11.4/bin/install_solr_service.sh solr-8.11.4.zip

Runs the original operation with administrator privileges; confirm paths and version requirements.

sudo systemctl enable solr

Manages or checks a system service.

sudo systemctl start solr

Manages or checks a system service.

sudo systemctl status solr

Manages or checks a system service.

http://localhost:8983/solr

A URL in the original guide, not a shell command.

Legacy or security-sensitive instruction — verify compatibility before execution.

05Download Backend and Configure Tomcat
sudo mkdir /build

Creates the specified directory.

cd /build

Changes the current working directory.

sudo wget https://github.com/DSpace/DSpace/archive/refs/tags/dspace-8.0.zip

Downloads a file or resource from a remote source; verify the URL and authenticity.

sudo unzip dspace-8.0.zip

Runs the original operation with administrator privileges; confirm paths and version requirements.

sudo chmod 777 -R /build

Changes permissions to allow access by everyone. Unsafe on production systems; included only to preserve the historical source.

Legacy or security-sensitive instruction — verify compatibility before execution.

sudo apt install tomcat10 -y

Installs the named packages and their dependencies.

sudo mousepad /lib/systemd/system/tomcat10.service

Opens a file in an editor for manual configuration.

ReadWritePaths=/dspace

Original installation command or configuration value. Follow the surrounding steps for correct context.

sudo mousepad /etc/tomcat10/server.xml

Opens a file in an editor for manual configuration.

<Connector port="8080" protocol="HTTP/1.1"
            connectionTimeout="20000"
            redirectPort="8443" />

Multi-line source text. Follow the original context: not every block is a standalone shell command.

<!-- <Connector port="8080" protocol="HTTP/1.1"
            connectionTimeout="20000"
            redirectPort="8443" /> -->

Multi-line source text. Follow the original context: not every block is a standalone shell command.

<Connector port="8080" protocol="HTTP/1.1"
            minSpareThreads="25"
            enableLookups="false"
            redirectPort="8443"
            connectionTimeout="20000"
            disableUploadTimeout="true"
            URIEncoding="UTF-8"/>

Multi-line source text. Follow the original context: not every block is a standalone shell command.

sudo systemctl restart tomcat10.service

Manages or checks a system service.

sudo systemctl daemon-reload

Manages or checks a system service.

sudo systemctl restart tomcat10.service

Manages or checks a system service.

06Configure DSpace Database
sudo su postgres

Runs the original operation with administrator privileges; confirm paths and version requirements.

cd /etc/postgresql/16/main

Changes the current working directory.

createuser --username=postgres --no-superuser --pwprompt dspace

Original installation command or configuration value. Follow the surrounding steps for correct context.

createdb --username=postgres --owner=dspace --encoding=UNICODE dspace

Original installation command or configuration value. Follow the surrounding steps for correct context.

psql --username=postgres dspace -c "CREATE EXTENSION pgcrypto;"

Original installation command or configuration value. Follow the surrounding steps for correct context.

exit

Original installation command or configuration value. Follow the surrounding steps for correct context.

cd /build/DSpace-dspace-8.0/dspace/config

Changes the current working directory.

sudo cp local.cfg.EXAMPLE local.cfg

Runs the original operation with administrator privileges; confirm paths and version requirements.

sudo mousepad local.cfg

Opens a file in an editor for manual configuration.

dspace.server.url = http://localhost:8080/server

Original installation command or configuration value. Follow the surrounding steps for correct context.

Legacy or security-sensitive instruction — verify compatibility before execution.

dspace.ui.url = http://localhost:4000

Original installation command or configuration value. Follow the surrounding steps for correct context.

Legacy or security-sensitive instruction — verify compatibility before execution.

# Name of the site
dspace.name = DSpace at My University

Multi-line source text. Follow the original context: not every block is a standalone shell command.

# Database username and password
db.username = dspace
db.password = dspace

Multi-line source text. Follow the original context: not every block is a standalone shell command.

solr.server = http://localhost:8983/solr

Original installation command or configuration value. Follow the surrounding steps for correct context.

Legacy or security-sensitive instruction — verify compatibility before execution.

07Build and Initialize
sudo su

Runs the original operation with administrator privileges; confirm paths and version requirements.

cd /build/DSpace-dspace-8.0

Changes the current working directory.

mvn package

Original installation command or configuration value. Follow the surrounding steps for correct context.

cd dspace/target/dspace-installer

Changes the current working directory.

ant fresh_install

Original installation command or configuration value. Follow the surrounding steps for correct context.

exit

Original installation command or configuration value. Follow the surrounding steps for correct context.

sudo cp -R /dspace/webapps/* /var/lib/tomcat10/webapps

Runs the original operation with administrator privileges; confirm paths and version requirements.

sudo cp -R /dspace/solr/* /var/solr/data

Runs the original operation with administrator privileges; confirm paths and version requirements.

sudo chown -R solr:solr /var/solr/data

Changes file ownership; check the destination path and user.

sudo systemctl restart solr

Manages or checks a system service.

cd /dspace/bin/

Changes the current working directory.

sudo ./dspace database migrate

Runs the original operation with administrator privileges; confirm paths and version requirements.

08Create Administrator and Verify Backend
sudo /dspace/bin/dspace create-administrator

Starts creation of a DSpace administrator account.

sudo chown -R tomcat:tomcat /dspace/

Changes file ownership; check the destination path and user.

sudo systemctl restart tomcat10.service

Manages or checks a system service.

http://localhost:8080/server

A URL in the original guide, not a shell command.

Legacy or security-sensitive instruction — verify compatibility before execution.

http://localhost:8080/server/oai/request?verb=Identify

A URL in the original guide, not a shell command.

Legacy or security-sensitive instruction — verify compatibility before execution.

09Install Angular Frontend
sudo apt install nodejs -y

Installs the named packages and their dependencies.

sudo apt install npm

Installs the named packages and their dependencies.

sudo npm install --global yarn

Runs the original operation with administrator privileges; confirm paths and version requirements.

sudo npm install --global pm2

Runs the original operation with administrator privileges; confirm paths and version requirements.

sudo su

Runs the original operation with administrator privileges; confirm paths and version requirements.

cd /home/dspace

Changes the current working directory.

sudo wget https://github.com/DSpace/dspace-angular/archive/refs/tags/dspace-8.0.zip

Downloads a file or resource from a remote source; verify the URL and authenticity.

unzip dspace-8.0.zip

Original installation command or configuration value. Follow the surrounding steps for correct context.

rm dspace-8.0.zip

Original installation command or configuration value. Follow the surrounding steps for correct context.

cd /home/dspace/dspace-angular-dspace-8.0

Changes the current working directory.

yarn install

Original installation command or configuration value. Follow the surrounding steps for correct context.

cd config

Changes the current working directory.

cp config.example.yml config.prod.yml

Original installation command or configuration value. Follow the surrounding steps for correct context.

mousepad config.prod.yml

Original installation command or configuration value. Follow the surrounding steps for correct context.

# The REST API server settings
# NOTE: these settings define which (publicly available) REST API to use. They are usually
# 'synced' with the 'dspace.server.url' setting in your backend's local.cfg.
rest:
  ssl: false
  host: localhost
  port: 8080

Multi-line source text. Follow the original context: not every block is a standalone shell command.

yarn run build:prod

Original installation command or configuration value. Follow the surrounding steps for correct context.

exit

Original installation command or configuration value. Follow the surrounding steps for correct context.

sudo mousepad /home/dspace/dspace-angular-dspace-8.0/dspace-ui.json

Opens a file in an editor for manual configuration.

{
    "apps": [
        {
           "name": "dspace-ui",
           "cwd": "/home/dspace/dspace-angular-dspace-8.0/",
           "script": "dist/server/main.js",
           "instances": "max",
           "exec_mode": "cluster",
           "env": {
              "NODE_ENV": "production"
           }
        }
    ]
}

Multi-line source text. Follow the original context: not every block is a standalone shell command.

sudo su

Runs the original operation with administrator privileges; confirm paths and version requirements.

pm2 start /home/dspace/dspace-angular-dspace-8.0/dspace-ui.json

Original installation command or configuration value. Follow the surrounding steps for correct context.

crontab -e

Original installation command or configuration value. Follow the surrounding steps for correct context.

#Auto start dspace-angular
@reboot bash -ci 'pm2 start /home/dspace/dspace-angular-dspace-8.0/dspace-ui.json'

Multi-line source text. Follow the original context: not every block is a standalone shell command.

10Verify Installation
http://localhost:4000

A URL in the original guide, not a shell command.

Legacy or security-sensitive instruction — verify compatibility before execution.

pm2 install pm2-logrotate

Original installation command or configuration value. Follow the surrounding steps for correct context.

pm2 set pm2-logrotate:max_size 1000K

Original installation command or configuration value. Follow the surrounding steps for correct context.

pm2 set pm2-logrotate:compress true

Original installation command or configuration value. Follow the surrounding steps for correct context.

pm2 set pm2-logrotate:rotateInterval 0 0 19 1 1 7

Original installation command or configuration value. Follow the surrounding steps for correct context.

sudo rm -rf /build

Removes files recursively and forcefully. Verify the full path before executing.

Legacy or security-sensitive instruction — verify compatibility before execution.

About & Official Resources

DSpace is an open-source platform for institutional repositories and managing and preserving digital scholarly outputs.