# Upgrade

> Move a self-hosted memex to the newest image, keeping your notes.

Page: https://docs.memex.tools/self-hosted-upgrade

### 1. Pull the new image

```
docker pull ghcr.io/artem-kolesnikov/memex
```

### 2. Replace the container

```
docker rm -f memex
docker run -d --name memex -p 127.0.0.1:8080:8080 -v memex:/data --restart unless-stopped ghcr.io/artem-kolesnikov/memex
```

Run it with the same options you started it with.

The notes stay on the volume, and memex brings their files up to date when it opens them. If you built the image yourself, `git pull` and build it again instead of `docker pull`.

## Related

- [Back up and restore](https://docs.memex.tools/self-hosted-backups): Where a self-hosted memex keeps its daily backups, how to copy them off the machine, and how to restore one.
- [Install self-hosted memex](https://docs.memex.tools/self-hosted-install): Run memex in Docker on your own computer, a home server or a virtual machine, and create its one account.
