Link Search Menu Expand Document
Start for Free

Use Docker

This page describes how to run Stardog via Docker.


To run Stardog via Docker please following the following steps:

  1. Install Docker

  2. Confirm that the docker daemon is running in the background.

     $ docker version
    

    If you do not see the server listed, start the Docker daemon.

  3. The latest release of Stardog is available on Docker Hub. You can pull the image from Docker Hub with:

     $ docker pull stardog/stardog:latest
    
    • The STARDOG_HOME directory is located in /var/opt/stardog/ in the Docker image. This is the directory where all the Stardog databases and other files will be stored.
  4. Start the Stardog server

    Some Docker volume drivers do not respect Stardog’s lock file which may cause data loss if two Stardogs use the same $STARDOG_HOME. Please see the Administrating Stardog 101 section for more details.

    Because stardog-admin server start (the command to start up the Stardog server) is the entry point for the Docker image, you must instruct Docker to mount a home directory with a valid license from your host machine at /var/opt/stardog in the image. For example:

     $ docker run -it -v ~/stardog-home/:/var/opt/stardog -p 5820:5820 stardog/stardog
    
    • In this example, ~/stardog-home/ is a Stardog home directory that only contains a Stardog license file. /var/opt/stardog is the location of Stardog home in the Docker image. If you do not have a license file, you should be prompted in your terminal to enter your email to download one.

    • The contents of the distribution (binaries, docs, helm charts) are located in /opt/stardog/.

    • Note, we use the -p flag to map port 5820 on the container (the default Stardog port) to port 5820 on localhost for easy communication with the server.

    If the server starts up successfully, you should see something like the following in your terminal:

     ************************************************************
     This copy of Stardog is licensed to Stardog Trial User (somebodyAwesome@university.edu), Stardog Union
     This is a trial Enterprise license
     This license will expire in 355 days on Tue Oct 26 22:09:08 UTC 2021
     ************************************************************
    
                                                                 :;
                                         ;;                   `;`:
     `'+',    ::                        `++                    `;:`
     +###++,  ,#+                        `++                    .
     ##+.,',  '#+                         ++                     +
     ,##      ####++  ####+:   ##,++` .###+++   .####+    ####++++#
     `##+     ####+'  ##+#++   ###++``###'+++  `###'+++  ###`,++,:
     ####+    ##+        ++.  ##:   ###  `++  ###  `++` ##`  ++:
     ###++,  ##+        ++,  ##`   ##;  `++  ##:   ++; ##,  ++:
         ;+++  ##+    ####++,  ##`   ##:  `++  ##:   ++' ;##'#++
         ;++  ##+   ###  ++,  ##`   ##'  `++  ##;   ++:  ####+
     ,.   +++  ##+   ##:  ++,  ##`   ###  `++  ###  .++  '#;
     ,####++'  +##++ ###+#+++` ##`   :####+++  `####++'  ;####++`
     `####+;    ##++  ###+,++` ##`    ;###:++   `###+;   `###++++
                                                         ##   `++
                                                     .##   ;++
                                                         #####++`
                                                         `;;;.
     ************************************************************
    
    
     Stardog server 7.3.0 started on Thu Nov 05 21:42:54 UTC 2020.
    
     Stardog server is listening on all network interfaces.
     HTTP server available at http://localhost:5820.
    
     STARDOG_HOME=/var/opt/stardog/
    

Configuring Memory Settings

If needed, you can change the default JVM memory settings for Stardog by setting the STARDOG_SERVER_JAVA_ARGS environment variable like so:

$ docker run -v ~/stardog-home/:/var/opt/stardog -p 5820:5820 -e STARDOG_SERVER_JAVA_ARGS="-Xmx8g -Xms8g -XX:MaxDirectMemorySize=12g" stardog/stardog

Configuring memory settings is discussed in greater detail in the Memory Usage section. It’s noted here for your reference if you are running Stardog via Docker.

What’s Next?

Get Stardog Studio, our IDE for interacting with Stardog, and connect to your running Stardog server.

Check out our additional Getting Started Resources for some introductory blog posts, tutorials, video trainings and more.