- Newest
- Most votes
- Most comments
- Backup: Take a snapshot of your Lightsail instance before upgrading.
- Connect: SSH into your Lightsail instance.
- Update Packages: Run sudo apt update and sudo apt upgrade -y to update packages.
- Upgrade to 22.04: Use sudo do-release-upgrade -d to upgrade from Ubuntu 20.04 to 22.04.
- Future Upgrade to 24.04: Once Ubuntu 24.04 is released, upgrade using the same command.
- Reboot: Reboot the instance after the upgrade with sudo reboot.
- Verify: Check the OS version with lsb_release -a to confirm the upgrade.
Considerations for Lightsail:
- Use snapshots for backups.
- Be mindful of performance limitations during the upgrade.
- Check and adjust firewall settings in the Lightsail console post-upgrade.
The process of upgrading Ubuntu on a Lightsail instance is similar to that on an EC2 instance, but with some Lightsail-specific considerations like using snapshots for backup and ensuring that networking and firewall configurations are properly set. Always take a snapshot before starting the upgrade to ensure you can recover if anything goes wrong.
Hi there,
Wanted to provide an alternative upgrade pathway. You can consider transitioning to a new instance using the ubuntu blueprint with the desired version. You can achieve this by creating a snapshot of your existing instance, then creating a new ubuntu instance using blueprint with the desired version. Once you've confirmed the application is setup on the new instance and working as expected, then you can look to deprecate the old one.
Here's a similar question asked previously for reference:
answered 2 years ago
Greeting
Hi Jim,
Thanks for your thoughtful question about upgrading Ubuntu on a Lightsail instance. It’s great that you’re planning ahead to ensure your instance is running the latest supported version of Ubuntu. Let's dive into the details to help you perform this upgrade smoothly and confidently. 😊
Clarifying the Issue
You’re looking to upgrade Ubuntu from 20.04 to 22.04 and eventually to 24.04 on a Lightsail instance. Rest assured, this is a common task for maintaining Lightsail instances, and with the right preparation, it can be done safely and effectively. If you’re hosting active applications, we’ll also outline steps to minimize downtime during the process.
Why This Matters
Upgrading Ubuntu on your Lightsail instance not only enhances security and system performance but also ensures compatibility with future software and dependencies. Additionally, maintaining an updated OS aligns with compliance standards and ensures long-term compatibility with AWS services and tools, protecting your infrastructure investment.
Key Terms
- Lightsail Instance: A simplified virtual private server offering from AWS for hosting applications.
- Snapshot: A backup of the entire Lightsail instance, useful for recovery in case of issues.
do-release-upgrade: A command-line utility for upgrading between Ubuntu releases.- Static IP: An unchanging IP address in Lightsail, useful for maintaining connections when migrating or rebooting instances.
The Solution (Our Recipe)
Steps at a Glance:
- Backup your Lightsail instance using snapshots and ensure adequate disk space for the upgrade.
- Update and upgrade packages on your current Ubuntu version.
- Upgrade to Ubuntu 22.04 using
do-release-upgrade. - Reboot your instance after the upgrade.
- Verify the upgrade and test your applications.
- (Optional) Use a staging environment to test upgrades before applying them to production.
- (Optional) Minimize downtime for active applications during the upgrade process.
Step-by-Step Guide:
- Backup your Lightsail instance using snapshots and ensure adequate disk space for the upgrade.
- Create a snapshot from the Lightsail console to preserve your current configuration.
- AWS Console Path:
Lightsail > Instances > Snapshot > + Create Snapshot. - Check your disk space with:
df -h
- Update and upgrade packages on your current Ubuntu version.
sudo apt update && sudo apt upgrade -y sudo apt autoremove -y
- Upgrade to Ubuntu 22.04 using
do-release-upgrade.
Ensure you’re ready for the upgrade, then execute:sudo do-release-upgrade- If no new release is detected, try enabling development upgrades with:
sudo do-release-upgrade -d
- If no new release is detected, try enabling development upgrades with:
- Reboot your instance after the upgrade.
sudo reboot
- Verify the upgrade and test your applications.
- Check the Ubuntu version:
lsb_release -a - Test your applications and services to ensure everything works as expected.
- Check the Ubuntu version:
- (Optional) Use a staging environment to test upgrades before applying them to production.
- Clone your existing instance into a new Lightsail instance for testing.
- Perform the upgrade on this instance to confirm the process runs smoothly without issues before applying it to production.
- (Optional) Minimize downtime for active applications during the upgrade process.
- Before rebooting, consider using a Lightsail load balancer to direct traffic to a temporary instance while upgrading.
- Alternatively, notify users of planned maintenance and schedule the upgrade during low-traffic hours.
Closing Thoughts
By following these steps, including using a staging environment, ensuring adequate storage space, and planning to minimize downtime for active applications, you can confidently upgrade your Ubuntu version on Lightsail while minimizing risks and disruptions. Remember, snapshots are your safety net, and testing ensures that your applications continue running smoothly.
Here are some helpful documentation links for reference:
- Create and Manage Lightsail Snapshots
- Ubuntu
do-release-upgradeGuide - AWS CLI for Lightsail
- Lightsail Load Balancers
Farewell
I hope this guide sets you up for success, Jim! If you have any further questions or run into issues during the upgrade, feel free to ask. Best of luck with your Lightsail instance upgrades! 🚀😊
Cheers,
Aaron 😊
answered 2 years ago
Relevant content
asked 4 years ago
asked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 10 months ago

There are no firewall setting changes needed via Lightsail console for an in-place or on-server ubuntu version upgrade. Firewall doesn't come into play at all. . Also taking a snapshot for backup is always recommended for any server before making changes or even as regular data recovery best practice. There is nothing different about that between EC2 and Lightsail.