Hosting & Deployment

Vercel

Vercel is a cloud platform for deploying web apps built with frameworks like Next.js, Nuxt, SvelteKit and Astro. It builds and deploys straight from your Git repository, gives every branch its own preview URL, and serves your site from its global edge network. Their free Hobby plan works well with DatoCMS for personal projects.

Warning: this guide assumes you have a working website project on your machine integrated with DatoCMS. If it's not the case, you can head over to the main documentation to see how to properly configure the DatoCMS administrative area and how to integrate DatoCMS with your favorite framework.

If you are starting now with Vercel and DatoCMS we suggest trying one of our starter projects. DatoCMS will automatically create a brand-new project with all the necessary integrations!

Step 1: Create a new project

Create a new repository on your favorite hosting service. To avoid errors, do not initialize the new repository with README, license, or .gitignore files. You can add these files after your project has been pushed to the hosting service.

Terminal window
$ git init
$ git add .

Commit the files that you've staged in your local repository.

Terminal window
$ git commit -m 'First commit'

At the top of your Git repository's Quick Setup page, click the clipboard icon to copy the remote repository URL. In Terminal, add the URL for the remote repository where your local repository will be pushed.

Terminal window
$ git remote add origin YOUR_GIT_REPOSITORY_URL

Now, it's time to push the changes in your local repository.

Terminal window
git push -u origin main

Now that your project is up and running on the Git hosting service, let's connect it to Vercel.

Step 2: Create a new Vercel project from the Git repo

Now that you have your new repo, we can instruct Vercel to read from it and build our site.

To do that, follow Vercel's instructions on how to create a Vercel project. Once you're done, you should see your new project on your Vercel dashboard.

Step 3: Connect Vercel to your DatoCMS project

By connecting DatoCMS to Vercel, every time your editors press the Publish changes button in your administrative area, a new build process on Vercel (thus a new publication of the final website) gets triggered.

To do that, start setting up a new build trigger in your DatoCMS dashboard, where you will be asked which project you want to add the integration to.

Choose one, and you will be redirected to your project. Now you have to connect your project to Vercel.

This is all! Now you can control the build process directly from your DatoCMS project!

Last updated: