# Updating a Ghost website

> Why you should keep your Ghost website up to date, and how to back it up and update it safely using Ghost-CLI.

Source: https://helpcenter.ruachost.com/apps/other-apps/updating-a-ghost-website/

Keep your Ghost website up to date to get security fixes, bug fixes and new features. Always take a backup before you update.

## Why updates matter

- **Security:** updates fix vulnerabilities that attackers can use to break into websites.
- **Stability:** bug fixes and performance improvements help your site run smoothly.
- **New features:** you get the latest editor, themes and membership tools.

## Before you update

1. **Export your content.** In Ghost Admin, go to **Settings**, find the **Import/Export** option, and export your content.
2. **Back up your files and database.** Your hosting account is backed up daily with JetBackup, but take your own copy before a major update. See [Importing and exporting a MySQL database](https://helpcenter.ruachost.com/developers/databases/importing-and-exporting-a-mysql-database/).
3. **Check your theme** is compatible with the new Ghost version, especially for major updates.

## Update with Ghost-CLI

If you installed Ghost with Ghost-CLI, connect to your account with SSH, go to your Ghost folder and run:

```bash
cd ~/path-to-your-ghost-site
ghost update
```

Ghost-CLI downloads the new version, updates your site and restarts it. If something goes wrong, you can return to the previous version with:

```bash
ghost update --rollback
```

For full instructions, including major version upgrades, see the [official Ghost update guide](https://ghost.org/docs/update/).

If you're not sure how Ghost was installed on your account, [contact support](https://helpcenter.ruachost.com/getting-started/guides/contact-support/) before updating.

## Related articles

- [Installing Ghost themes](https://helpcenter.ruachost.com/apps/other-apps/installing-ghost-themes/)
- [Migrating WordPress content to Ghost](https://helpcenter.ruachost.com/apps/other-apps/migrating-wordpress-content-to-ghost/)
