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.
Before continuing with the installation guide, please review the System Requirements for running Stardog.
Install as a Windows Service
-
Download the distribution.
-
Unzip the file and open a command prompt.
-
Setup
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.-
Create the directory to set
STARDOG_HOME
to in Command Prompt.You can set
STARDOG_HOME
to any directory, but we highly reccomend keeping this directory separate from the Stardog distribution:mkdir D:\Users\stardog\stardog_home
-
Set the
STARDOG_HOME
environment variable to the directory we just created:You can set the environment variable via Command Prompt with the following command:
set STARDOG_HOME=D:\Users\stardog\stardog_home
Setting the environment variable like so is temporary and will only last as long as the command prompt session.
or set a persistent environment variable through Window’s settings:
Launch “Control Panel” > “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.
-
-
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%
-
Optionally, place the
bin
folder of the unzipped Stardog distribution on yourPATH
so thestardog.bat
andstardog-admin.bat
scripts can be used regardless of current working directoryLike setting the environment variable for
STARDOG_HOME
, you can set a temporary environment variable from the command line:SET PATH=%PATH%;D:\Users\stardog\stardogs\stardog-7.4.0\bin
or set a persistent environment variable through Window’s settings:
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
.We now can use the
stardog
andstardog-admin
cli commands regardless of our current working directory. -
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 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” priviledges 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 on the Stardog website:
Once you’ve obtained a valid license, try starting up the Stardog service as shown in step 6.
What’s Next?
Access 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.