GraphDB: Use Docker Compose for GraphDB

GraphDB: Use Docker Compose for GraphDB

What is GraphDB?

"Ontotext GraphDB is a highly efficient, scalable and robust graph database with RDF and SPARQL support. With excellent enterprise features, integration with external search applications, compatibility with industry standards, and both community and commercial support, GraphDB is the preferred database choice of both small independent developers and big enterprises."

In fact, I don't know very much of GraphDB, but I can show you how to start it using Docker Compose:

services:
  db:
    image: ontotext/graphdb:10.8.3
    hostname: graphdb
    ports:
      - 7200:7200

We can pull the image and start the container:

# docker compose pull
# docker compose up -d
[+] Pulling 1/1
 ✔ db Pulled                                                                                   1.0s
[+] Running 1/1
 ✔ Container graphdb-db-1  Started                                                             0.3s

Let's have a look at the logs:

# docker compose logs -f
db-1  | [INFO ] 2025-02-13 12:42:23,031 [main | c.o.g.Config] Using 'jar:file:/opt/graphdb/dist/lib/graphdb-application-common-10.8.3.jar!/com/ontotext/graphdb/logback.xml' as logback's configuration file
db-1  | [INFO ] 2025-02-13 12:42:23,402 [main | c.o.g.s.GraphDB] Starting GraphDB in workbench mode.
db-1  | [INFO ] 2025-02-13 12:42:36,437 [main | c.o.g.Config] GraphDB Home directory: /opt/graphdb/home
db-1  | [INFO ] 2025-02-13 12:42:36,438 [main | c.o.g.Config] GraphDB Config directory: /opt/graphdb/home/conf
db-1  | [INFO ] 2025-02-13 12:42:36,439 [main | c.o.g.Config] GraphDB Data directory: /opt/graphdb/home/data
db-1  | [INFO ] 2025-02-13 12:42:36,439 [main | c.o.g.Config] GraphDB Work directory: /opt/graphdb/home/work
db-1  | [INFO ] 2025-02-13 12:42:36,439 [main | c.o.g.Config] GraphDB Logs directory: /opt/graphdb/home/logs
db-1  | [INFO ] 2025-02-13 12:42:37,158 [main | c.o.f.c.s.r.GraphDBRpcServer] Started gRPC server on port 7300 successfully
db-1  | [INFO ] 2025-02-13 12:42:37,465 [main | c.o.l.LicenseRegistry] License configuration: Embedded license
db-1  | [INFO ] 2025-02-13 12:42:37,466 [main | c.o.l.LicenseRegistry] License file: jar:file:/opt/graphdb/dist/lib/graphdb-runtime-10.8.3.jar!/GRAPHDB_LITE.license
db-1  | [INFO ] 2025-02-13 12:42:37,470 [main | c.o.l.LicenseRegistry] Product:                 GRAPHDB_LITE
db-1  | [INFO ] 2025-02-13 12:42:37,470 [main | c.o.l.LicenseRegistry] Capabilities:            [LUCENE_CONNECTOR]
db-1  | [INFO ] 2025-02-13 12:42:37,470 [main | c.o.l.LicenseRegistry] Usage restriction:       null
db-1  | [INFO ] 2025-02-13 12:42:37,470 [main | c.o.l.LicenseRegistry] Licensee:                Freeware
db-1  | [INFO ] 2025-02-13 12:42:37,470 [main | c.o.l.LicenseRegistry] Permitted use:           THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
db-1  | [INFO ] 2025-02-13 12:42:37,470 [main | c.o.l.LicenseRegistry] Version:                 10.8
db-1  | [INFO ] 2025-02-13 12:42:37,470 [main | c.o.l.LicenseRegistry] Expiry date:             none
db-1  | [INFO ] 2025-02-13 12:42:37,470 [main | c.o.l.LicenseRegistry] Latest publication date: none
db-1  | [INFO ] 2025-02-13 12:42:37,470 [main | c.o.l.LicenseRegistry] Max CPU cores:           1
db-1  | [INFO ] 2025-02-13 12:42:40,353 [main | c.o.g.s.GraphDB] Started GraphDB in workbench mode at port 7200.

After that, GraphDB is accessible. You can connect to it using the URL

http://localhost:7200

After a fresh installation, GraphDB is insecure. You can secure it like that: go to Setup -> Users and Access:

Change the password by clicking the pencil on the right:

After entering the password twice, click Enter to save.

Then, activate security by switching Security to ON:

A new window is opened where you can enter username and password you entered previously.