# Incus Container Snapshots

**URL:** https://discussion.scottibyte.com/t/incus-container-snapshots/371
**Category:** Uncategorized
**Created:** [March 15, 2024, 8:37pm UTC](https://discussion.scottibyte.com/t/incus-container-snapshots/371 "2024-03-15T20:37:21Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![scott](https://discussion.scottibyte.com/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@scott](https://discussion.scottibyte.com/u/scott)
#### Post date: [March 15, 2024, 8:37pm UTC](https://discussion.scottibyte.com/t/incus-container-snapshots/371/1 "2024-03-15T20:37:21Z")

</div>

Snapshots are point in time backups of a container that can be used to roll back a container to a state when the backup was made. Incus Snapshots are stored inside of a container and make the container larger.

Incus Snapshots are functionally equivalent to LXD Snapshots, but the commands are different.

In the video, I create a sample container:

```auto
incus launch images:ubuntu/22.04 container1

```

To take a snapshot and call it “snapshot1”:

```auto
incus snapshot create container1 snapshot1 

```

In contrast, the command in LXD is:

```auto
lxc snapshot container1 snapshot1

```

To delete an incus snapshot:

```auto
incus snapshot delete container1 snapshot1

```

In LXD, this command is:

```auto
lxc delete container1/snapshot1

```

We created the snapshot again in the video for example purposes:

```auto
incus snapshot create container1 snapshot1 

```

The command to list all of the information on a container including snapshots is:

```auto
incus info container1

```

Incus has a new command that LXD does not to list all the snapshots on a container:

```auto
incus snapshot list container1

```

![image](https://discussion.scottibyte.com/uploads/default/original/1X/e8e34bd9b66071a3e1eef4dd486a87c85583b365.png)

You can set snapshots to occur automatically according to a schedule with commands like the following:

```auto
incus config set container1 snapshots.schedule @daily
incus config set container1 snapshots.schedule "0 6 * * *"

```

I have a tutorial on “How to Schedule LXD Snapshots” that goes into depth on LXD Snapshots schedules that is applicable to incus as well.

We can rename an incus snapshot:

```auto
incus snapshot rename container1 snapshot1 snapshot2

```

In contrast to that, the LXD command is:

```auto
lxc rename container1/snapshot1 container1/snapshot2

```

To verify that the snapshot was renamed:

```auto
incus snapshot list container1

```

![image](https://discussion.scottibyte.com/uploads/default/original/1X/fa3106cd77bad0ba7dcb26005414ffaed56af48a.png)

There is also a “snapshot show” command that gives a verbose listing of all of the attributes of a snapshot:

```auto
incus snapshot show container1 snapshot2

```

 ![image](https://discussion.scottibyte.com/uploads/default/original/1X/24182cca816f9ea0f27df9eb65c0984fd6a45b7b.jpeg)

It’s also possible to take a new snapshot that overwrites a current snapshot. This is useful and does the same as deleting and creating a new snapshot of the same name, but with a single step.

```auto
incus snapshot create container1 snapshot2 --reuse

```

![image](https://discussion.scottibyte.com/uploads/default/original/1X/2d9df0e51e530673812623c6e7f5fbebf464be26.png)

You can change some parameters associated with a snapshot like the expiration date by editing it with the following command:

```auto
incus config edit container1/snapshot2

```

 ![image](https://discussion.scottibyte.com/uploads/default/original/1X/a8a9c1201819999e93947e19f0afe33650942e34.jpeg)

Lets rename snapshot2 to snapshot1:

```auto
incus snapshot rename container1 snapshot2 snapshot1

```

Now if we list the snapshots:

 ![image](https://discussion.scottibyte.com/uploads/default/original/1X/a4b7b60429fc8c67f02021cb7219abd8ad3f1216.png)

You can restore from a snapshot to revert a container back to the state when the snapshot was taken:

```auto
incus snapshot restore container1 snapshot1

```

In LXD, that command is:

```auto
lxc restore container1 snapshot1

```

Images can be created in both LXD and Incus. I have covered images before. When you launch a new container, you are doing so using the image as a starting point.

You can create your own custom images which you can use to create containers from.

For the purpose of this tutorial, we are able to also create an image from a snapshot:

```auto
incus publish container1/snapshot1 --alias mycoolimage description="My Stuff"

```

You can list the images stored on your server (the use space in your storage pool):

```auto
incus image list

```

 ![image](https://discussion.scottibyte.com/uploads/default/original/1X/9ad57d57e2fa7abcbabf6b05e9fa0398402a8d95.jpeg)

To create a new container with this image:

```auto
incus launch mycoolimage container2

```

![image](https://discussion.scottibyte.com/uploads/default/original/1X/d364695e2d370a82350ffad88cd914ade2891b7e.png)
