Free Astro tutorials for complete beginners.

Beginner's Guide to Astro

How to Back Up an Astro Site (It's Easier Than You Think)

An Astro site is a folder of files, so the backup is GitHub. Here's why that's complete, how to do it in two clicks, and the one thing it doesn't cover.

Cover image for How to Back Up an Astro Site (It's Easier Than You Think)
In this guide
  1. Why Astro backups are simple
  2. Step 1: Put your site on GitHub
  3. Step 2: Know how to get it back
  4. Step 3: Keep one copy off GitHub
  5. What this doesn’t cover
  6. Compare it to WordPress
  7. Where to go next
  8. Frequently asked questions

WordPress users buy backup plugins, schedule backups, and still lose sites. Astro users mostly don’t think about backups at all, and they’re right not to. Here’s why, and the two things you should still do.

Why Astro backups are simple

Your whole Astro site is a folder. Pages, posts, images, settings, all files. There’s no database holding your content hostage, unless you added a CMS, and we’ll get to that.

Git tracks every change to those files. GitHub keeps a copy of the whole history online. Every time you commit and push, you’ve made a complete backup that you can roll back to any point. That’s not a backup strategy. That’s just how the tools work.

Step 1: Put your site on GitHub

If you followed lesson 7, you’ve done this. If not:

  1. In VS Code, click the Source Control icon on the left edge.
  2. Click Publish to GitHub. Sign in when asked. Choose private unless you want the code public.
  3. VS Code uploads your whole project.

From now on, when you change something: click Commit, type a short note, then click Sync. Your backup is current.

Step 2: Know how to get it back

A backup you can’t restore isn’t one. Try this once so you’ve seen it work:

  1. On GitHub, open your repository and click Commits. There’s a list of every change with your notes.
  2. Click one from a while ago. GitHub shows exactly what the site looked like then.
  3. To go back to it, in VS Code’s Source Control panel, find the commit in the history and choose Checkout or Revert.

Also know this: if your computer dies, you install VS Code on the new one, click Clone Repository, paste your GitHub address, and your site is back in a minute. Node and npm install bring the tools back. Nothing is lost.

Step 3: Keep one copy off GitHub

GitHub is reliable. Accounts, though, get locked, passwords get lost, and companies change rules. Once a month, download a zip of your repository: on GitHub, the green Code button, then Download ZIP. Drop it in your cloud drive. It takes a minute and covers the case nobody plans for.

What this doesn’t cover

  • Your CMS content. If you use EmDash, your posts live in a Cloudflare D1 database, not in files. Cloudflare provides exports for D1. Do one when you’ve written something you’d miss. Other CMSs have their own export buttons. Use them.
  • The domain. It’s a yearly rental, not a file. Turn on auto-renew. More sites are lost to expired domains than to lost files.
  • Secret keys. Files like .env hold passwords and are kept out of Git on purpose. Store those in a password manager.
  • Your host settings. Redirect rules and custom domains live at the host. Write them down in your README.md so you can redo them in ten minutes.

Compare it to WordPress

Astro WordPress
What’s being backed up A folder of files Files plus a database
How Git, automatically on every push A plugin, on a schedule
Rolling back one change Built in Full restore, usually
Cost Free Free to $10 a month

Where to go next

Frequently asked questions

Do I need a backup plugin for Astro?

No. There's nothing like that, because you don't need it. Your site is files, and Git with GitHub keeps every version of every file. That is the backup.

Is GitHub enough on its own?

For the site, yes. Keep a second copy somewhere else if you'd sleep better, like a zip in your cloud drive once a month. It takes a minute.

What about my CMS content?

If you use a CMS like EmDash, your content lives in its database, not in your files. Back that up separately. EmDash runs on Cloudflare D1, which has its own export.

Stuck on a step?

Check the common errors guide, look up a word in the glossary, or ask the friendly people in the official Astro and EmDash Discords. How to ask so people can help.

Keep reading

  1. How Much Does an Astro Website Cost? (Real Numbers)

    An Astro site can cost $0 a year. Here's what's free, what costs money, and what we actually pay for this site, so you can plan before you start.

    Beginner's guides, 6 minute read, November 8, 2026

  2. Domain Name vs Web Hosting: What's the Difference?

    A domain name is your site's address. Hosting is the computer your site lives on. Here's how the two connect, in plain words, and what each one costs.

    Beginner's guides, 4 minute read, November 8, 2026

  3. How to Make Money With an Astro Blog (7 Honest Ways)

    A static Astro site can earn money the same ways a WordPress blog can, and it costs nothing to run. Here are seven ways that work, what each needs, and what to skip.

    Beginner's guides, 9 minute read, November 8, 2026

Try "blog", "deploy" or "EmDash".