EC2
backup
AWS
cloud computing
disaster recovery

How to make a daily back up of my ec2 instance?

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Introduction

For an EC2 instance, a "daily backup" usually means daily EBS snapshots of the instance volumes, not copying the entire virtual machine image by hand every day. The safest approach depends on what you actually need to restore: a whole instance, only the attached disks, or the application data inside them.

For most workloads, the practical AWS-native choices are EBS snapshots through Data Lifecycle Manager or a backup plan through AWS Backup. Both let you automate daily recovery points instead of creating snapshots manually.

Decide What You Need to Restore

Before choosing a tool, separate these backup targets:

  • the EC2 instance configuration
  • the EBS volumes attached to the instance
  • the application data stored on those volumes

If you only snapshot the volumes, you can recover the data and rebuild the instance around it. If you also want machine-level re-creation, you may additionally keep infrastructure as code, launch templates, or AMIs depending on the use case.

That distinction matters because "backup the EC2 instance" is often really "backup the persistent storage."

Use Automated EBS Snapshots

If your instance uses EBS volumes, daily snapshots are the standard backup mechanism. AWS can create point-in-time snapshots without you manually stopping the instance every day.

The core automation idea is:

  1. identify the volumes to protect
  2. apply a daily schedule
  3. define a retention rule

If you script the operation yourself, the essential AWS CLI call looks like this:

bash
aws ec2 create-snapshot \
  --volume-id vol-0123456789abcdef0 \
  --description "Daily backup for app volume"

That creates one snapshot. The problem is not the command. It is the scheduling, tagging, retention, and cleanup around it. That is why most teams move quickly to managed automation instead of cron plus raw snapshot calls.

Prefer a Managed Daily Policy

Two common managed options are:

  • EBS snapshot lifecycle automation
  • AWS Backup plans

The advantage of a managed policy is that it handles repeated execution and retention consistently. Instead of remembering to create and prune snapshots yourself, you define the rule once and let AWS keep creating daily recovery points.

For example, a sane daily policy often means:

  • run once every day
  • keep the last 7, 14, or 30 snapshots
  • tag backups clearly

That is enough for many small and medium EC2 recovery scenarios.

Think About Consistency, Not Just Scheduling

A backup is only useful if the data inside it is consistent enough to restore. For ordinary filesystems, EBS snapshots are often fine while the instance is running. But for busy databases or write-heavy applications, you may want application-aware preparation first.

That can mean:

  • flushing pending writes
  • freezing the filesystem briefly
  • coordinating with the database engine

This is the difference between "a snapshot exists" and "the backup restores cleanly under stress." Daily automation is only half of the answer. Restore quality is the other half.

Test the Restore Path

Many backup setups look good until the first actual restore. The real validation step is to restore a volume or recovery point and verify that the application data is usable.

A practical test routine is:

  • restore to a new volume or instance
  • attach and mount the restored storage
  • verify critical files or database state

That turns backups from a checkbox into an actual recovery plan.

Common Pitfalls

The biggest mistake is treating EC2 backup as a single feature when the real target is usually the EBS data.

Another common issue is creating snapshots daily without any retention policy. That works technically, but storage costs grow and backup sets become harder to manage.

It is also easy to assume a crash-consistent snapshot is always application-consistent. For simple workloads that may be good enough. For databases, you may need extra preparation.

Finally, do not skip restore testing. A backup that has never been restored is only partially verified.

Summary

  • Daily EC2 backup usually means daily snapshots of attached EBS volumes.
  • Automate the schedule and retention instead of creating snapshots manually forever.
  • Use managed AWS backup policies when possible.
  • Consider application consistency, not just snapshot existence.
  • Test restores regularly so the backup process proves it can recover real data.

Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.