Tina Docs
Home
Blog
Showcase
Community
Introduction
Overview
Introduction To TinaCMS
Getting Started
Using the Tina Editor
FAQ
Core Concepts
Content Modeling
Data Fetching
Visual Editing
Querying Content
Overview
Writing custom queries
Editing
Overview
Markdown & MDX
Block-based editing
Single Document Collections
Customizing Tina
Overview
Validation
Custom Field Components
Custom List Rendering
Format and Parse Input
Filename Customization
Before Submit function
Going To Production
Overview
Tina Cloud
Self-Hosted
Introduction
Getting Started
Querying Content
User Management
Drafts
Overview
Draft Fields
Editorial Workflow
Guides
Overview
Framework Guides
Separate Content Repo
Querying Tina Content at Runtime
Internationalization
Migrating From Forestry
Further Reference
Overview
Config
Schema
The "tina" folder
The TinaCMS CLI
Media
Search
Content API
Tina's edit state
The "tinaField" helper
Self-Hosted Components

Introduction

For users who do not wish to host their CMS backend on TinaCloud, we provide a self-hosting option. This allows you to run your own TinaCMS Backend, with the flexibility to provide your own database, authentication, and Git integration, independent of TinaCloud.

Want to jump into the code? Check out the Self-hosted Starter Docs.

What is the Tina Data Layer

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.

TinaCMS GraphQL Data Layer

Check out the blog post for more info

How Does Self-hosting Work?

When you opt to self-host TinaCMS's backend, you'll be configuring a single API function to act as the backend service. This function will expose a GraphQL endpoint for your content and handle all aspects of authentication and authorization.

The TinaCMS backend is designed to be compatible with any Node.js serverless environment, such as Vercel or Netlify. We provide a Next.js starter that can be deployed to Vercel with a single click. You can also deploy to Netlify or any other serverless environment.

// pages/api/tina/[...routes].{ts,js}
// ...
import { TinaNodeBackend } from '@tinacms/datalayer'
const tinaHandler = TinaNodeBackend({
// ...
})
export default (req, res) => {
return tinaHandler(req, res)
}
Note: This is a Next.js example, but you can use TinaCMS with any framework.

The backend setup consists of three main, configurable modules:

    • Handles authentication and authorization for CMS operations. A default Auth.js implementation backed by a user collection in your database is provided.
    • Handles indexing and interaction with the database (e.g. MongoDB, Postgres, etc.)
    • Handles saving content to Git

Each module is designed to be standalone, meaning you have the option to replace any module with a different implementation or develop a custom solution to fit your specific needs.

Note: Some features are not available when self-hosting TinaCMS. See the Self-hosted Limitations section for more info.

Next Steps

Join the TinaCMS Community

  • Discord: Join our Discord community to connect with other TinaCMS users and developers. It’s a great space to get help, share your work, and discuss ideas
  • GitHub: Open an issue to report problems or suggest new features. We welcome your bug reports, feature requests, and contributions to our discussions. If you're passionate about TinaCMS and want to help make it even better, we encourage you to contribute to our code and documentation!

Last Edited: July 6, 2023

Previous
GraphQL API Versioning
Next
Using the Next.js Vercel Example

Product

Showcase
TinaCloud
Introduction
How Tina Works
Roadmap

Resources

Blog
Examples
Support
Media

Whats New
TinaCMS
TinaCloud
Use Cases
Agencies
Documentation
Teams
Jamstack CMS
Benefits
MDX
Markdown
Git
Editorial Workflow
Customization
SEO
Comparisons
TinaCMS vs Storyblok
TinaCMS vs Sanity
TinaCMS vs DecapCMS
TinaCMS vs Contentful
TinaCMS vs Builder.io
TinaCMS vs Strapi
Integrations
Astro
Hugo
NextJS
Jekyll