Deploy an Astro site on your own domain

This guide deploys a static Astro site to Naijacloud from your terminal and puts it on your own domain. At the end you’ll have every page Astro builds served over HTTPS, first at your naijacloud.app address and then at your domain, with a one-command redeploy for every change. The stack is Astro 7, deployed with the naijacloud CLI. Static sites are free and don’t count against the free tier’s one app.

10 minBeginnerLast verified 2026-10-07astro
What you'll have at the end

Your Astro pages, each built to its own HTML file, served at your naijacloud.app address and then at your own domain with a certificate issued for you.

https://<your-site>.naijacloud.app
Deploy this templateAstro blog template

Before you start

  • Node.js 20 or newer.
  • A Naijacloud account and a project to put the site in. This guide uses a project called shop and its dev environment.
  • A domain you can add DNS records to, for the last step.

Create the site

Skip this if you have an Astro site already. Otherwise:

Terminal
$ npm create astro@latest my-astro-site -- --template minimal
$ cd my-astro-site

Astro builds static HTML into dist by default, one file per page, which is exactly what a static site serves. If you’ve added an SSR adapter, this guide isn’t the one: deploy it as a web service instead.

Install the CLI and deploy

Terminal
$ npm install -g @naijacloud/cli
$ naijacloud login
$ naijacloud deploy --name my-astro-site --output dist --no-spa --env shop/dev

deploy runs npm run build on your machine, uploads dist and waits for it to go live:

naijacloud deploy
[build] 2 page(s) built in 144ms
[build] Complete!
Created site my-astro-site in the target environment
BUILDING
DEPLOYING
RUNNING
https://my-astro-site.naijacloud.app
Wrote naijacloud.json

--no-spa matters for Astro: every page has its own file, so a path that doesn’t exist should be a 404, not your home page. Commit naijacloud.json; after that, naijacloud deploy on its own redeploys this site.

Add the domain

In the dashboard, open the site and go to Domains. Type your domain into Custom domain and click Add domain. The table under it lists the records to create, with a Type, Name and Value for each and a copy button on every value.

Add each record at your DNS provider exactly as shown. A root domain such as example.com gets an A record. When you add a root domain, the dashboard also offers Add www, which redirects www.example.com to it; add the record it shows for www too.

Wait for HTTPS

The domain shows Waiting for DNS… and checks again on its own; Check now checks immediately. Once the record resolves to Naijacloud, the certificate is issued and the status changes to Verified · HTTPS ready. New records can take a few minutes, and sometimes longer, to reach every resolver.

Open https://example.com. Your site is there, and it stays at its naijacloud.app address too.

Whatever you build it with, it ships here.

Deploy your app for free

Free tier forever · No card