EN
Log in Create an account

How to set up Directus on Saplo (headless CMS)

Contentful can charge thousands of dollars a month for a project with real traffic because you pay for every API call, not just for hosting content. Directus is an open-source headless CMS that generates an admin panel directly from your database schema and exposes REST and GraphQL without writing any backend code. You can host it on your own Box without query limits.

Grzegorz Kalmus ·

Agencies building a website or app for a client sooner or later encounter the question of where to store content: texts, product photos, blog posts, and data displayed on the frontend. Contentful solves this problem, but it charges by the number of API calls, so the bill grows with the client's website traffic, even if the content itself doesn't change. Directus is an open-source headless CMS that does the same without a query counter: you connect a database, and you get a ready-made admin panel automatically generated from the database schema, along with REST and GraphQL APIs right out of the box. Below is a step-by-step guide on how to set up Directus on Saplo.

Why Directus Instead of Contentful

Contentful and similar paid headless CMS solutions have two characteristics that are most troublesome for agencies working with multiple clients simultaneously:

  • Billing based on API calls - The more traffic a client's website generates, the higher the monthly bill, and with several projects on one account, costs add up.
  • Content models must be built manually from scratch in the provider's panel - Directus, instead, reads the existing database schema and automatically generates the administrative panel from it; collections correspond to tables, and fields correspond to columns.

Directus is not a separate content database detached from the rest of the system; it's a layer on top of your own database. If an agency already has a data model designed for a specific project, Directus exposes it as an API instead of forcing them to rewrite the structure to fit someone else's format.

Requirements

To set up Directus on Saplo, you need:

  • A Box with Docker running (the engine automatically enables it when installing from the catalog; container nesting is required, which Saplo has by default),
  • A minimum of 1 GB RAM free on the Box and 3 GB disk space, meaning a Box M plan or higher,
  • A domain or subdomain *.saploapp.pl included with every plan, where the Directus panel will be located,
  • Your own PostgreSQL container. The Saplo engine has a shared database only for MySQL/MariaDB, so Directus gets a dedicated postgres:16-alpine container in the same docker-compose, you don't need to configure anything manually.

Step-by-step installation

  1. In the Saplo panel, go to App catalog and select Directus (under the "Data" category).
  2. Specify a Box with at least 1 GB of free RAM, where Directus will be installed, and the domain or subdomain under which the panel will operate.
  3. Confirm the installation. The engine sets up a dedicated Postgres container and a Directus container from the official image directus/directus, generates random values for KEY and SECRET required by the application, exposes the panel only on the Box's loopback, and connects it to nginx, which serves it under the specified domain with free SSL. Only port 443 is exposed externally, not the raw container port.
  4. The Directus container starts only after Postgres signals readiness (healthcheck pg_isready), and the engine additionally checks via docker compose up if the container is actually running, because the command's success itself does not mean that the process inside did not crash a moment later.
  5. After the installation is complete, the Directus panel is available under the specified domain.

First-time setup

Directus automatically sets up an administrator account on first launch with an empty database, so as with Listmonk or Paperless-ngx, you don't go through a separate registration wizard.

  1. Go to your domain address, for example, cms.saploapp.pl. You'll find the login credentials (email and a randomly generated password) in the DIRECTUS-SETUP.txt file in the application directory on Box.
  2. Change the administrator password immediately after the first login in Settings -> Users. Keep the data from the setup file only until this change.
  3. In Data Settings, create your first Collection. Directus immediately suggests fields for typical cases, such as text, number, image, or a relation to another collection, and each collection is one table in the Postgres database.
  4. Open the Settings -> Roles & Permissions tab and configure the Public role. If your frontend needs to read content from the API without logging in, this is where you grant read-only access to selected collections.
  5. Check the generated endpoints at https://cms.saploapp.pl/items/<collection_name> (REST) and https://cms.saploapp.pl/graphql (GraphQL); both work immediately without additional configuration.

Directus on Saplo vs. Contentful

Contentful Directus on Saplo
Pricing model fee increases with API calls and record count fixed Box cost, unlimited queries
Content model manually built from scratch in the provider panel automatically generated from your database schema
Database closed, access only via provider API your own Postgres, you have full access
API REST and GraphQL, query limit depends on plan REST and GraphQL with no call counter
Where is the data Contentful's infrastructure Your Box

FAQ

Is Directus suitable for a project that already has a designed database? Yes, this is its strong point. The admin panel and API are automatically generated from the schema of an existing database, so you don't have to rewrite the data model to a format imposed by the CMS provider.

Do I need to set up a Postgres database myself before installation? No, the Saplo engine sets up a dedicated Postgres container together with Directus in the same docker-compose and injects the connection data itself. For the installation itself, you don't need any external configuration.

Does the Directus API have a call limit? No, unlike Contentful or similar paid services, the number of queries to REST and GraphQL is limited only by the Box's resources, not by a counter in the price list.

Can Directus be connected to a Next.js frontend or a mobile application? Yes, that's what Directus is for. The frontend or mobile application retrieves content via the generated REST or GraphQL API, and the client's editorial team edits it in a separate panel, without access to the code.

Why do I need to look for the first login credentials in a file on the Box, and not in an email? Directus automatically creates an administrator account when the container first starts. The Saplo engine saves the generated password in the DIRECTUS-SETUP.txt file in the application directory instead of sending it by email, following the same pattern as with other applications with an automatic starter account.

If you are building a project with a separate frontend and need a content backend without a bill for every API call, write to us, we will help you choose the right Box for your project's scale.

  • #Agencies
  • #API
  • #Directus
  • #Headless CMS
  • #Guide