> ## Content Index
> Fetch the complete content index at: https://aquasp.blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# Quick Fix: Stop Ubuntu 24.04 from Automatically Suspending/Sleeping
- URL: https://aquasp.blog/quick-fix-stop-ubuntu-24-04-from-automatically-suspending-sleeping/
- Published: 2025-12-12T19:58:45.000Z
- Updated: 2025-12-12T19:58:45.000Z
- Description: If your Ubuntu 24.04 system (especially one that started as a server install) randomly suspends or goes to sleep even though it's supposed to be a headless server, you're not alone. This guide will show you to fix right away!
- Author: Aquasp
- Tags: Quick Fix

If your Ubuntu 24.04 system (especially one that started as a server install) randomly suspends or goes to sleep even though it's supposed to be a headless server, you're not alone.

This seems to happen when a server installation gets partially or fully converted to a "desktop" environment at some point — even if you never intentionally installed a desktop. In my case, I installed Ubuntu Server 24.04 directly with balenaEtcher onto NVMe/SSD and I got this weird behavior (my N100 server was suspending after 15 minutes).

### The Simple One-Liner Fix

Run this single command and the random suspensions stop immediately (and persist across reboots):

```bash
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
```

That is it!