Set up LinkedDataHub on your local machine with Docker

Start LinkedDataHub

This section assumes you will be running on your local machine, i.e. localhost. If you intend to run it on a different host, change the system base URI.

Prerequisites:

Steps:

  1. Fork the LinkedDataHub repository and clone the fork into a folder
  2. In the folder, copy .env_sample to .env and fill in the values. For example:
    COMPOSE_CONVERT_WINDOWS_PATHS=1
    COMPOSE_PROJECT_NAME=linkeddatahub
    
    PROTOCOL=https
    HTTP_PORT=81
    HTTPS_PORT=4443
    HOST=localhost
    
    OWNER_MBOX=john@doe.com
    OWNER_GIVEN_NAME=John
    OWNER_FAMILY_NAME=Doe
    OWNER_ORG_UNIT=My unit
    OWNER_ORGANIZATION=My org
    OWNER_LOCALITY=Copenhagen
    OWNER_STATE_OR_PROVINCE=Denmark
    OWNER_COUNTRY_NAME=DK
    If port 81 or 4443 is already in use on your machine, choose different HTTP_PORT/HTTPS_PORT values.
  3. Set up the server's TLS certificates by running this from the command line:
    ./bin/server-cert-gen.sh .env nginx ssl
    The script will create an ssl/server sub-folder where the TLS certificate will be stored.
  4. Create the following secrets with certificate/truststore passwords:
    • secrets/client_truststore_password.txt
    • secrets/owner_cert_password.txt
    • secrets/secretary_cert_password.txt
    The one you will need to remember in order to authenticate with LinkedDataHub using WebID client certificate is owner_cert_password.
  5. (Optional) If you need to configure Bearer token authentication for SPARQL services, create secrets/credentials.trig with your service credentials. See the configuration reference for details.
  6. Run this from the command line:
    make up -- --build
    (make up forwards its arguments to docker-compose up; the -- is needed before arguments starting with -.) LinkedDataHub will start and mount the following sub-folders:
    LinkedDataHub/
    ├── config/     # dataspace and service configuration (dataspaces.trig, system.trig)
    ├── datasets/   # owner and secretary agent metadata
    ├── fuseki/     # the triplestore's persisted RDF data, one TDB2 directory per dataset
    ├── ssl/
    │   ├── owner/      # your WebID certificate (keystore.p12)
    │   └── secretary/  # the service agent's certificate
    └── uploads/    # content-hashed file uploads

The administration dataspace of each dataspace is served on the admin. subdomain — for the default setup that is https://admin.localhost:4443/. Browsers resolve *.localhost automatically and the generated server certificate covers the subdomain, so the local setup works out of the box. On any other host, make sure admin.<host> resolves in DNS and is covered by the server's TLS certificate (e.g. a wildcard certificate).

You are now the owner of this LinkedDataHub instance; ssl/owner/keystore.p12 is your WebID certificate. The password is the value you put in secrets/owner_cert_password.txt.

Startup takes up to half a minute while the datasets are loaded into the triplestores. After a successful startup you should see periodic healthcheck requests being made to the https://localhost:4443/ns URL in the log:

linkeddatahub-1  | ... "GET /ns HTTP/1.1" 200 ...

Common commands

Common commands and what they do
Command Description
make up Start the services; extra arguments are forwarded to docker-compose up, e.g. make up -- --build to rebuild the images first
make down Stop the services; make down -- -v also removes the Docker volumes
make drop Wipe the setup completely, as described under Reset

make cli builds the command line interface and prints the line that puts it on your $PATH.

Reset

If you need to start fresh and wipe the existing setup, you can do that using:

make drop

It stops the services, removes the Docker volumes, and wipes the local datasets, fuseki, ssl and uploads folders.

This is destructive and cannot be undone.

Is LinkedDataHub running? Proceed to get an account.