January 31, 2023
By Scott Gallant & James O'Halloran
Today we're excited to announce the first iteration of TinaCMS's self-hosted Data Layer. See the in-depth walk through and demo here.
This has been a highly requested feature for a variety of reasons. Some feedback we've heard:
By self-hosting the Tina Data Layer, you can run TinaCMS without lock-in to Tina Cloud.
We're excited to get this in the community's hands so that we can learn, iterate, and flesh out the self-hosted experience.
The Tina Data Layer provides a GraphQL API that serves Markdown and JSON files backed by a database. You can think of the database as more of an ephemeral cache, since the single source of truth for your content is really your Markdown/JSON files.
As mentioned above, your Markdown files are the source of truth but TinaCMS still requires the Data Layer to do things like search, pagination, references between Markdown files, and more.
Also, since the Data Layer provides an API, you can fetch your content like you would with a traditional headless CMS.
When you’re developing your site locally, the Data Layer doesn’t need to be configured and just runs in the background. If you use Tina Cloud in production, it runs your Tina Data Layer for you and syncs with GitHub. Now, you can host your own Data Layer as an alternative to using Tina Cloud.
Most of TinaCMS is open-source under the Apache 2.0 but we chose a source-available license for the Tina Data Layer. This license limits some commercial usage but allows us to offer a cost-free, self-hosted solution for smaller sites like those used at startups or small and medium businesses. Source available licenses are used at many companies like MongoDB, Elastic, and Sentry. You can find the license and related FAQ in our repository.
We've designed the Data Layer so that it can be hosted as a Serverless function alongside your site (with Vercel/Netlify functions, for example). You can also host it separately wherever you like!
If you're self-hosting, you're also responsible for hosting your own database (Our self-hosted starter uses MongoDB).
To learn more about self-hosting the Data Layer, checkout the GitHub discussion.
Last Edited: February 6, 2023
Resources
© TinaCMS 2019–2025