Windows Installation
This page describes how to install Stardog on Windows.
Page Contents
Overview
Windows users can install and run Stardog as a Windows Service. Stardog on Windows is not recommended for production use.
Before continuing with the installation guide, please review the System Requirements for running Stardog.
Install as a Windows Service
-
Install Java if you have not already.
Stardog supports Java version 11.
-
Download the distribution.
-
Unzip the file and place it in your desired installation location.
We will place our installation in a new folder called
stardogs
for our user. In this tutorial, our user is namedstardog
, so the directory isD:\Users\stardog\stardogs
. -
Set up
STARDOG_HOME
.The most important piece of configuration to complete before you start the Stardog server is setting the
STARDOG_HOME
environment variable. This is the directory where all the Stardog databases and other files will be stored. IfSTARDOG_HOME
is not defined, Stardog will use the Javauser.dir
property value.You can set
STARDOG_HOME
to any directory, but this directory should be kept separate from the Stardog distribution.-
Create your
STARDOG_HOME
directory in the Command Prompt.The directory can be created with the following command:
mkdir D:\Users\stardog\stardog_home
-
Set the
STARDOG_HOME
environment variable to the directory we just created:We will do this by setting it in Control Panel. Launch “Control Panel” > “System and Security” > “System” > “Advanced system settings” > Switch to “Advanced” tab > “Environment variables…” > Choose “New” > Enter
STARDOG_HOME
for the variable and provide the path to the newly created directory as the value.You can also set the environment variable via Command Prompt, however this will only persist as long as the command prompt session. This can be done with the following command:
set STARDOG_HOME=D:\Users\stardog\stardog_home
-
-
Copy your Stardog license into the STARDOG_HOME directory:
If you do not have a license, you can obtain one on the Stardog website:
Once you have a license, copy or move your license key to your
STARDOG_HOME
directory created in the previous step.COPY /B stardog-license-key.bin %STARDOG_HOME%
By default, Stardog will recognize your license key if its name follows the pattern
stardog*.bin
(i.e.,stardog
, followed by anything, and ending with.bin
) and it resides in your home directory. You can specify a different location for the license file or a name that uses a different pattern by setting the environment variableSTARDOG_LICENSE_PATH
. -
Optionally, place the
bin
folder of the unzipped Stardog distribution on yourPATH
so thestardog.bat
andstardog-admin.bat
scripts can be used regardless of the current working directory.Launch “Control Panel” > “System” > “Advanced system settings” > Switch to “Advanced” tab > “Environment variables” > Select the entry containing
Path
, Choose “Edit”:Choose “New” and enter the full path to the
bin
directory within the unzipped Stardog distribution as a new entry on thePath
.or set an environment variable through the command line.
Like setting the environment variable for
STARDOG_HOME
, you can set a temporary environment variable from the command line, but it will only last as long as your command prompt session. The command is:SET PATH=%PATH%;D:\Users\stardog\stardogs\stardog-7.4.0\bin
We now can use the
stardog
andstardog-admin
CLI commands regardless of our current working directory. -
Set up
JAVA_HOME
.Setting the
JAVA_HOME
environment variable is necessary to run Stardog as a Windows service (covered in the next step).-
You must set it to the directory where you installed Java. For example, if you installed Microsoft OpenJDK 11 in
C:\Program Files\Microsoft\jdk-11.0.18.10-hotspot
, you would setJAVA_HOME=C:\Program Files\Microsoft\jdk-11.0.18.10-hotspot\
. -
You can follow the same process you took to make
STARDOG_HOME
an environment variable (see step 4b).
-
-
Execute the provided batch script
install-service.bat
in thebin
directory to install Stardog as a Windows service..\install-service.bat
You should see output in your prompt indicating the service was successfully installed:
AMD64 Architecture detected The following parameters will be set for the service Stardog installation directory is D:\Users\stardog\stardogs\stardog-7.4.0 STARDOG_HOME is D:\Users\stardog\stardog_home Stardog server will use 2048 MB Server logs will be written to D:\Users\stardog\stardogs\stardog-7.4.0\logs Installing Service "Stardog Server" Successfully installed "Stardog Server"
At this point you can control Stardog via the Windows Services App.
Troubleshooting
If the service does not successfully install or startup, you should inspect the stderr logs in the logs
directory within the Stardog distribution.
Insufficient Permissions
The service may fail to install if the current Windows user does not have sufficient permissions to install a service. You may see the following in your command prompt after executing the install-service.bat
script:
D:\Users\stardog\stardogs\stardog-7.4.0\bin>.\install-service.bat
AMD64 Architecture detected
The following parameters will be set for the service
Stardog installation directory is D:\Users\stardog\stardogs\stardog-7.4.0
STARDOG_HOME is D:\Users\stardog\stardog_home
Stardog server will use 2048 MB
Server logs will be written to D:\Users\stardog\stardogs\stardog-7.4.0\logs
Installing Service "Stardog Server"
Failed to install "Stardog Server"
Inspect D:\Users\stardog\stardogs\stardog-7.4.0\logs for more details
In the stderr log within the logs
directory (as shown in the above output) you should see the error:
Access is denied.
Failed to install service
In order to work around this, you may need to contact your system administrator with “Administrator” privileges, or if you’re able to, start up a new Command Prompt session as an Administrator. See below for how to access this option from “Control Panel”:
After opening this command prompt as an Administrator, proceed to re-install the service in step 5.
.\install-service.bat
Unable to find a valid license
The service may fail to start up if you do not have a valid license. In the stderr logs in <stardog-distribution>\logs
directory you would see a message like so:
2020-10-06 11:26:47 Commons Daemon procrun stderr initialized
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'org.apache.logging.log4j.simplelog.StatusLogger.level' to TRACE to show Log4j2 internal initialization logging.
A valid Stardog license was not found. Please visit https://stardog.com for more information.
If you have a valid license, copy or move the license to your STARDOG_HOME
directory.
COPY /B stardog-license-key.bin %STARDOG_HOME%
If you do not have a license, you can obtain one by speaking with a Stardog sales representative. If you do not want to manage your own Stardog license, you can simply sign up for a free account with Stardog Cloud.
Once you’ve obtained a valid license, try starting up the Stardog service as shown in step 8.
What’s Next?
Access your server through the CLI or the Stardog Applications (Stardog Studio, Stardog Explorer, and Stardog Designer).
Check out our additional Getting Started Resources for some introductory blog posts, tutorials, video trainings, and more.