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.

In this guide
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:
- In VS Code, click the Source Control icon on the left edge.
- Click Publish to GitHub. Sign in when asked. Choose private unless you want the code public.
- 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:
- On GitHub, open your repository and click Commits. There’s a list of every change with your notes.
- Click one from a while ago. GitHub shows exactly what the site looked like then.
- 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
.envhold 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.mdso 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
- How to deploy to Cloudflare Workers, where the host rebuilds your site from GitHub on every push.
- What is EmDash? if you’re thinking about a CMS and want to understand where content lives.
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.
