6. Deploy Your Site

Deploy your Doks site to Netlify or any other static web host.

On this page

👉

Make sure to set baseURL in ./config/production/config.toml to the URL of your Doks website in production.

Deploy to Netlify

Continuous Deployment (CD) works by connecting a Git repository to a Netlify site and keeping the two in sync. Netlify will run the Doks build command and deploy the result whenever you push to your Git repo.

Set up Git repository

Set up your Git repository in 8 steps.

1. Create a new repository

👉

To avoid errors, do not initialize the new repository with README, LICENSE, and .gitignore files.

Create a new repository on GitHub (or GitLab, or Bitbucket):

Create New Repository

Create new repository →

2. Initialize your local directory

Initialize your local Doks site directory as a Git repository:

  1. npm run init

3. Add your local files

Add the files in your new local repository. This stages them for the first commit:

  1. git add .

4. Commit your local files

Commit the files that you’ve staged in your local repository:

  1. git commit -m "First commit"

5. Copy your remote repository URL

At the top of your GitHub repository’s Quick Setup page, click the copy icon:

Copy Remote Repository URL Quick Setup

6. Set the new remote

Set the new remote — replace <remote repository URL> with yours:

  1. git remote add origin <remote repository URL>

7. Verify the new remote

Verify the new remote:

  1. git remote -v

8. Push local changes

Push the changes in your local repository to GitHub:

  1. git push -u origin main

Create new Netlify site

Create your new Netlify site in 3 steps.

Create New Netlify Site

New site from Git →

1. Connect to Git provider

2. Pick a repository

3. Build options, and deploy!

Deploy to other hosts

See the Hugo Docs: Hosting & Deployment.