Short answer

DSpace’s command line is /dspace/bin/dspace. Run it as the dspace user: sudo -iu dspace /dspace/bin/dspace <command>. With no command it lists them all. The ones you will use most are version, database test, dsprop, user, index-discovery, structure-builder, metadata-export, curate and healthcheck.

Tested on Ubuntu 26.04 and 24.04, two separate runs. On 24.04, every step is the same. Everything that differed

This lesson starts from a DSpace server set up as in Install DSpace. Every output below is what DSpace 10.1 printed on the test server.

List the commands

Server
$ sudo -iu dspace /dspace/bin/dspaceYou must provide at least one command argumentUsage: dspace [command-name] {parameters} Commands from launcher.xml - anonymize-statistics: Anonymize the ip values of the solr statistics - bitstore-migrate: Assetstore migration tool - checker: Run the checksum checker - checker-emailer: Send emails related to the checksum checker - classpath: Calculate and display the DSpace classpath - cleanup: Remove deleted bitstreams from the assetstore - community-filiator: Tool to manage community and sub-community relationships - create-administrator: Create a DSpace administrator account - database: Perform database tasks like test database connection, migrate/repair database, remove database - doi-migrate: Migrate DOI metadata from legacy fields to new standard fields - doi-organiser: Run the DOI organiser - dsprop: View a DSpace property from dspace.cfg - dsrun: Run a class directly - embargo-lifter: Embargo manager tool used to check, list and lift embargoes - generate-sitemaps: Generate search engine and html sitemaps - harvest: Manage the OAI-PMH harvesting of external collections[… 56 lines not shown …]
Output hidden (21 lines)

Add -h after any command for its options, for example sudo -iu dspace /dspace/bin/dspace index-discovery -h.

Which DSpace, Java and OS: dspace version

Server
$ sudo -iu dspace /dspace/bin/dspace versionDSpace version:  10.1  SCM revision:  UNKNOWN_REVISION    SCM branch:  UNKNOWN_BRANCH            OS:  Linux(amd64) version 7.0.0-43-generic  Applications:     Discovery:  enabled.           JRE:  Ubuntu version 21.0.13.1   Ant version:  Apache Ant(TM) version 1.10.15 compiled on January 13 2026 Maven version:  3.9.12   DSpace home:  /dspace
Output hidden (10 lines)

Check the database: database test and database info

Server
$ sudo -iu dspace /dspace/bin/dspace database test Attempting to connect to databaseConnected successfully! Database Type: postgresDatabase URL: jdbc:postgresql://localhost:5432/dspaceDatabase Schema: publicDatabase Username: dspaceDatabase Software: PostgreSQL version 17.12 (Ubuntu 17.12-1.pgdg26.04+1)Database Driver: PostgreSQL JDBC Driver version 42.7.13FlywayDB Version: 10.22.0
Output hidden (11 lines)

database info adds every schema migration and its state. After an install or upgrade, all of them should say Success:

Server
$ sudo -iu dspace /dspace/bin/dspace database info Database Type: postgresDatabase URL: jdbc:postgresql://localhost:5432/dspaceDatabase Schema: publicDatabase Username: dspaceDatabase Software: PostgreSQL version 17.12 (Ubuntu 17.12-1.pgdg26.04+1)Database Driver: PostgreSQL JDBC Driver version 42.7.13FlywayDB Version: 10.22.0 +-----------+-----------------+------------------------------------------------------------------+----------+---------------------+----------+----------+| Category  | Version         | Description                                                      | Type     | Installed On        | State    | Undoable |+-----------+-----------------+------------------------------------------------------------------+----------+---------------------+----------+----------+|           | 1               | << Flyway Baseline >>                                            | BASELINE | 2026-11-20 04:24:38 | Baseline | No       || Versioned | 1.1             | Initial DSpace 1.1 database schema                               | SQL      | 2026-11-20 04:24:38 | Success  | No       || Versioned | 1.2             | Upgrade to DSpace 1.2 schema                                     | SQL      | 2026-11-20 04:24:38 | Success  | No       || Versioned | 1.3             | Upgrade to DSpace 1.3 schema                                     | SQL      | 2026-11-20 04:24:38 | Success  | No       |[… 76 lines not shown …]
Output hidden (17 lines)

Read a setting as DSpace sees it: dsprop

Settings come from dspace.cfg, local.cfg and the module files, with local.cfg winning. dsprop prints the value DSpace actually uses:

Server
$ sudo -iu dspace /dspace/bin/dspace dsprop --property dspace.server.urlhttp://localhost:8080/server
Output hidden (1 line)

Accounts: user

Server
$ sudo -iu dspace /dspace/bin/dspace user --list1668c14c-66c1-4164-bfa6-729dafb3b829	admin@example.org/null	Admin, Ada
Output hidden (1 line)

The same tool adds, changes and deletes accounts; Reset a forgotten DSpace admin password uses it.

Create communities and collections from a file: structure-builder

Describe them in XML. A community named Theses with one collection:

Server
$ sudo -iu dspace bash -c "cat > /tmp/structure.xml" <<'EOF'<import_structure>  <community>    <name>Theses</name>    <collection>      <name>Master's theses</name>    </collection>  </community></import_structure>EOF
Server
$ sudo -iu dspace /dspace/bin/dspace structure-builder -f /tmp/structure.xml -o /tmp/structure-out.xml -e admin@example.org

It prints nothing. The output file gives each new community and collection its handle:

Server
$ sudo -iu dspace cat /tmp/structure-out.xml<?xml version="1.0" encoding="UTF-8"?><imported_structure><community identifier="123456789/1"><name>Theses</name><description></description><collection identifier="123456789/2"><name>Master's theses</name><description></description></collection></community></imported_structure>
Output hidden (2 lines)

Rebuild the search index: index-discovery

Server
$ sudo -iu dspace /dspace/bin/dspace index-discovery -bThe script has started(Re)building index from scratch.Done with indexingThe script has completed
Output hidden (4 lines)

-b rebuilds everything; without it, only what changed. If this stops with “Expected mime type application/octet-stream but got text/html”, see the Solr fix.

Export metadata to CSV: metadata-export

Server
$ sudo -iu dspace /dspace/bin/dspace metadata-export -i 123456789/1 -f /tmp/theses.csvThe script has startedExporting community 'Theses' (123456789/1)The script has completed
Output hidden (3 lines)
Server
$ sudo -iu dspace head -n 3 /tmp/theses.csvid,collection
Output hidden (1 line)

The community has no items yet, so the file has only its header. With items, each is a row you can edit and load back with metadata-import.

Run a curation task: curate

Curation tasks check or change items in bulk; profileformats counts the file formats under an object. Without -e it fails:

Server
$ sudo -iu dspace /dspace/bin/dspace curate -t profileformats -i 123456789/1[… 20 lines not shown …]task queue: CurationCli -q monthlyorg.apache.commons.cli.ParseException: Required parameter -e missing!	at org.dspace.curate.CurationCli.assignCurrentUserInContext(CurationCli.java:45)	at org.dspace.curate.Curation.setup(Curation.java:255)	at org.dspace.scripts.DSpaceRunnable.parse(DSpaceRunnable.java:122)	at org.dspace.scripts.DSpaceRunnable.initialize(DSpaceRunnable.java:95)	at org.dspace.app.launcher.ScriptLauncher.executeScript(ScriptLauncher.java:170)	at org.dspace.app.launcher.ScriptLauncher.handleScript(ScriptLauncher.java:152)	at org.dspace.app.launcher.ScriptLauncher.handleScript(ScriptLauncher.java:126)	at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:101)
Output hidden (11 lines)

“Required parameter -e missing!”: on the command line a task runs as an account you name. With an administrator’s email and -v to see what it did:

Server
$ sudo -iu dspace /dspace/bin/dspace curate -t profileformats -i 123456789/1 -e admin@example.org -vThe script has startedAdding task: profileformatsStarting curationCurating id: 123456789/1Curation task: profileformats performed on: 123456789/1 with status: 0. Result: ''Ending curation. Elapsed time: 35The script has completed
Output hidden (7 lines)

Thumbnails and full text: filter-media

Server
$ sudo -iu dspace /dspace/bin/dspace filter-media -vThe script has startedThe following MediaFilters are enabled:Full Filter Name: org.dspace.app.mediafilter.JPEGFilterorg.dspace.app.mediafilter.JPEGFilterFull Filter Name: org.dspace.app.mediafilter.TikaTextExtractionFilterorg.dspace.app.mediafilter.TikaTextExtractionFilterFull Filter Name: org.dspace.app.mediafilter.PDFBoxThumbnailorg.dspace.app.mediafilter.PDFBoxThumbnailThe script has completed
Output hidden (9 lines)

With -v it lists the filters that are on: thumbnails from images and PDFs, and text extraction for full-text search.

Remove deleted files: cleanup

Server
$ sudo -iu dspace /dspace/bin/dspace cleanup -vFound 0 deleted bitstream to cleanupCommitting changes to the database... Done!
Output hidden (2 lines)

A health report: healthcheck

Server
$ sudo -iu dspace /dspace/bin/dspace healthcheck #### General Information [took: 0s] [# lines: 5]Generated: 2026-11-20T04:28:17.891570683ZFrom - Till: 2026-11-13 - 2026-11-20Url: http://localhost:4000 Directory [/dspace/assetstore] does not exist!Log dir size        : 31 MB ###############################  #### Checksum [took: 2s] [# lines: 1]No md5 checks made! ###############################  #### Item summary [took: 0s] [# lines: 21]Community [Theses]: 0 Collection sizes:Total size:              0 bytesResource without policy: 0Deleted bitstreams:      0Orphan bitstreams:       0 [] Published items (archived, not withdrawn): 0Withdrawn items: 0Not published items (in workspace or workflow mode): 0	Waiting for approval (workflow items): 0Count Bitstream     : 0Count Bundle        : 0Count Collection    : 1Count Community     : 1Count MetadataValue : 9Count EPerson       : 1Count Item          : 0Count Handle        : 3Count Group         : 2[… 34 lines not shown …]
Output hidden (41 lines)

It sums up the last week: checksums, item counts, users, errors in the log. On the test server no file had been uploaded yet, hence “Directory [/dspace/assetstore] does not exist!” and no checksums.

Always as the dspace user

Run every command with sudo -iu dspace, the user the services run as, so files the command creates belong to the right user. On the test server, dspace version run as root also worked and left no root-owned files in /dspace/log.

Server
$ sudo /dspace/bin/dspace version
Server
$ sudo find /dspace/log -not -user dspace -printf '%u %p\n' | head -n 5

Troubleshooting

  • Required parameter -e missing! from curate: add -e and an administrator’s email. Details.
  • You must provide at least one command argument: dspace was run without a command; that message comes with the list. Details.
  • Expected mime type application/octet-stream but got text/html from index-discovery: a Solr problem. The fix.

What these steps changed on the server

Both runs recorded the server before the first step and after the last (see the Tested on box below): one community and one collection in the database, the search index, and files in /tmp. No package, service or file under /etc changed.

Ubuntu 26.04 vs 24.04

The same check ran on a fresh 26.04 server and on a fresh 24.04 server, each with its own run log. The commands printed the same apart from versions, ids and times; the versions differ as in the table.

WhatUbuntu 26.04Ubuntu 24.04
SystemUbuntu 26.04.1 LTS7.0.0-43-genericUbuntu 24.04.5 LTS6.8.0-149-generic
openjdk-21-jdk-headless21.0.13.1+2-1~26.04.121.0.13.1+2-1~24.04.1
maven3.9.12-1not installed
ant1.10.15-1build11.10.14-1
postgresql-1717.12-1.pgdg26.04+1not installed
dspace10.110.1
solr9.11.09.11.0
postgresql-16not installed16.15-0ubuntu0.24.04.1
Commands and resultsThe same on every release: the same commands, the same results.
ProofRun log, 37 checks passedRun log, 37 checks passed