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.
01Prepare Ubuntu
sudo apt update && sudo apt upgrade -yRefreshes the local package index using configured repositories.
sudo useradd -m dspaceRuns the original operation with administrator privileges; confirm paths and version requirements.
sudo passwd dspaceRuns the original operation with administrator privileges; confirm paths and version requirements.
sudo usermod -aG sudo dspaceRuns the original operation with administrator privileges; confirm paths and version requirements.
sudo mkdir /dspaceCreates the specified directory.
sudo chown dspace /dspaceChanges file ownership; check the destination path and user.
sudo apt install wget curl git build-essential mousepad zip unzip -yInstalls the named packages and their dependencies.
02Install Java and Tools
sudo apt install openjdk-17-jdk -yInstalls the named packages and their dependencies.
sudo mousepad /etc/environmentOpens 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/environmentOriginal installation command or configuration value. Follow the surrounding steps for correct context.
echo $JAVA_HOMEOriginal installation command or configuration value. Follow the surrounding steps for correct context.
echo $JAVA_OPTSOriginal installation command or configuration value. Follow the surrounding steps for correct context.
sudo apt install maven ant -yInstalls the named packages and their dependencies.
03Configure PostgreSQL
sudo apt-get install postgresql postgresql-client postgresql-contrib libpostgresql-jdbc-java -yInstalls the named packages and their dependencies.
psql -V psqlOriginal installation command or configuration value. Follow the surrounding steps for correct context.
sudo pg_ctlcluster 16 main startRuns the original operation with administrator privileges; confirm paths and version requirements.
sudo systemctl status postgresqlManages or checks a system service.
sudo passwd postgresRuns the original operation with administrator privileges; confirm paths and version requirements.
su postgresOriginal installation command or configuration value. Follow the surrounding steps for correct context.
exitOriginal installation command or configuration value. Follow the surrounding steps for correct context.
sudo mousepad /etc/postgresql/16/main/postgresql.confOpens 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.confOpens a file in an editor for manual configuration.
#DSpace configuration
host dspace dspace 127.0.0.1 255.255.255.255 md5Multi-line source text. Follow the original context: not every block is a standalone shell command.
sudo systemctl restart postgresqlManages or checks a system service.
04Install Apache Solr
cdOriginal 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.zipDownloads a file or resource from a remote source; verify the URL and authenticity.
sudo unzip solr-8.11.4.zipRuns 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.zipRuns the original operation with administrator privileges; confirm paths and version requirements.
sudo systemctl enable solrManages or checks a system service.
sudo systemctl start solrManages or checks a system service.
sudo systemctl status solrManages or checks a system service.
http://localhost:8983/solrA 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 /buildCreates the specified directory.
cd /buildChanges the current working directory.
sudo wget https://github.com/DSpace/DSpace/archive/refs/tags/dspace-8.0.zipDownloads a file or resource from a remote source; verify the URL and authenticity.
sudo unzip dspace-8.0.zipRuns the original operation with administrator privileges; confirm paths and version requirements.
sudo chmod 777 -R /buildChanges 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 -yInstalls the named packages and their dependencies.
sudo mousepad /lib/systemd/system/tomcat10.serviceOpens a file in an editor for manual configuration.
ReadWritePaths=/dspaceOriginal installation command or configuration value. Follow the surrounding steps for correct context.
sudo mousepad /etc/tomcat10/server.xmlOpens 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.serviceManages or checks a system service.
sudo systemctl daemon-reloadManages or checks a system service.
sudo systemctl restart tomcat10.serviceManages or checks a system service.
06Configure DSpace Database
sudo su postgresRuns the original operation with administrator privileges; confirm paths and version requirements.
cd /etc/postgresql/16/mainChanges the current working directory.
createuser --username=postgres --no-superuser --pwprompt dspaceOriginal installation command or configuration value. Follow the surrounding steps for correct context.
createdb --username=postgres --owner=dspace --encoding=UNICODE dspaceOriginal 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.
exitOriginal installation command or configuration value. Follow the surrounding steps for correct context.
cd /build/DSpace-dspace-8.0/dspace/configChanges the current working directory.
sudo cp local.cfg.EXAMPLE local.cfgRuns the original operation with administrator privileges; confirm paths and version requirements.
sudo mousepad local.cfgOpens a file in an editor for manual configuration.
dspace.server.url = http://localhost:8080/serverOriginal 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:4000Original 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 UniversityMulti-line source text. Follow the original context: not every block is a standalone shell command.
# Database username and password
db.username = dspace
db.password = dspaceMulti-line source text. Follow the original context: not every block is a standalone shell command.
solr.server = http://localhost:8983/solrOriginal 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 suRuns the original operation with administrator privileges; confirm paths and version requirements.
cd /build/DSpace-dspace-8.0Changes the current working directory.
mvn packageOriginal installation command or configuration value. Follow the surrounding steps for correct context.
cd dspace/target/dspace-installerChanges the current working directory.
ant fresh_installOriginal installation command or configuration value. Follow the surrounding steps for correct context.
exitOriginal installation command or configuration value. Follow the surrounding steps for correct context.
sudo cp -R /dspace/webapps/* /var/lib/tomcat10/webappsRuns the original operation with administrator privileges; confirm paths and version requirements.
sudo cp -R /dspace/solr/* /var/solr/dataRuns the original operation with administrator privileges; confirm paths and version requirements.
sudo chown -R solr:solr /var/solr/dataChanges file ownership; check the destination path and user.
sudo systemctl restart solrManages or checks a system service.
cd /dspace/bin/Changes the current working directory.
sudo ./dspace database migrateRuns the original operation with administrator privileges; confirm paths and version requirements.
08Create Administrator and Verify Backend
sudo /dspace/bin/dspace create-administratorStarts 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.serviceManages or checks a system service.
http://localhost:8080/serverA 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=IdentifyA 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 -yInstalls the named packages and their dependencies.
sudo apt install npmInstalls the named packages and their dependencies.
sudo npm install --global yarnRuns the original operation with administrator privileges; confirm paths and version requirements.
sudo npm install --global pm2Runs the original operation with administrator privileges; confirm paths and version requirements.
sudo suRuns the original operation with administrator privileges; confirm paths and version requirements.
cd /home/dspaceChanges the current working directory.
sudo wget https://github.com/DSpace/dspace-angular/archive/refs/tags/dspace-8.0.zipDownloads a file or resource from a remote source; verify the URL and authenticity.
unzip dspace-8.0.zipOriginal installation command or configuration value. Follow the surrounding steps for correct context.
rm dspace-8.0.zipOriginal installation command or configuration value. Follow the surrounding steps for correct context.
cd /home/dspace/dspace-angular-dspace-8.0Changes the current working directory.
yarn installOriginal installation command or configuration value. Follow the surrounding steps for correct context.
cd configChanges the current working directory.
cp config.example.yml config.prod.ymlOriginal installation command or configuration value. Follow the surrounding steps for correct context.
mousepad config.prod.ymlOriginal 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: 8080Multi-line source text. Follow the original context: not every block is a standalone shell command.
yarn run build:prodOriginal installation command or configuration value. Follow the surrounding steps for correct context.
exitOriginal installation command or configuration value. Follow the surrounding steps for correct context.
sudo mousepad /home/dspace/dspace-angular-dspace-8.0/dspace-ui.jsonOpens 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 suRuns the original operation with administrator privileges; confirm paths and version requirements.
pm2 start /home/dspace/dspace-angular-dspace-8.0/dspace-ui.jsonOriginal installation command or configuration value. Follow the surrounding steps for correct context.
crontab -eOriginal 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:4000A URL in the original guide, not a shell command.
Legacy or security-sensitive instruction — verify compatibility before execution.
pm2 install pm2-logrotateOriginal installation command or configuration value. Follow the surrounding steps for correct context.
pm2 set pm2-logrotate:max_size 1000KOriginal installation command or configuration value. Follow the surrounding steps for correct context.
pm2 set pm2-logrotate:compress trueOriginal installation command or configuration value. Follow the surrounding steps for correct context.
pm2 set pm2-logrotate:rotateInterval 0 0 19 1 1 7Original installation command or configuration value. Follow the surrounding steps for correct context.
sudo rm -rf /buildRemoves 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.