Link Search Menu Expand Document
Start for Free

Running the Stardog Server

This page discusses running the Stardog Server.

Page Contents
  1. Starting the Server
    1. Locking the Home Directory
  2. Stopping the Server
  3. Safe Mode to start the server
    1. Enabling the safe mode

Starting the Server

Unlike the other stardog-admin subcommands, starting the server may only be run locally (i.e. on the same machine the Stardog Server will run on).

The simplest way to start the server — running on the default port, detaching to run as a daemon, and writing stardog.log to the current working directory — is:

$ stardog-admin server start

To specify parameters, such as a custom port to bind the server to:

$ stardog-admin server start --port=8080

Stardog binds its server to You can specify a different network interface for Stardog to bind to using the --bind property of server start.

For more information on the server start command, please see its man page.

Locking the Home Directory

Stardog server will lock STARDOG_HOME when it starts in order to prevent synchronization errors and other issues. This prevents running more than one Stardog server with the same STARDOG_HOME. If you need to run more than one Stardog server instance, choose a different STARDOG_HOME, or pass a different value to the --home option.

Do not manually delete the lock file. Please see the Administrating Stardog 101 section for more information about common pitfalls with the lock file.

Stopping the Server

Stopping the server is simple:

$ stardog-admin server stop

By default, this will stop a server running on localhost on the default port (5820). If the server is not on localhost and/or the port is not 5820, you can use the --server option to provide the URL of the server to stop.

For more information on the server stop command, please see its man page.

Safe Mode to start the server

Safe mode helps users overcome initialization errors when starting the server. This feature ensures that the server may start up, even if there is an issue with a component. Safe mode should be a temporary fallback, only for starting servers which no longer start due to a misconfiguration. Safe mode is not supported with the HA Cluster. In a clustered environment, you must use safe mode on a single node. Once you finish making changes on one node, the other nodes may be restarted and sync from the healthy node.

Safe mode will do the following:

  • Disable additional modules (all of them or those selected by the user) so the server can start
  • Offline all databases, so they cannot be queried nor updated
  • Allow changing of all mutable database options
  • Change Data Source and Virtual Graph configurations
  • Support user/role/permission changes
  • Create a server backup as a precaution before making further changes, i.e. stardog-admin server backup

Situations where one would use the Safe Mode include:

  • A corrupted database prevents the start of the server
  • Misconfigured virtual graph prevents server startup. This could include missing jars for drivers, etc.
  • User info is corrupted and the Server fails to start

Enabling the safe mode

The --safe option can be added to the stardog-admin server start command:

$ stardog-admin server start --safe --port=8080

Alternatively, you may add a property to the file. After you have resolved the issue, you should disable safe mode by removing this property.