Skip to content

Raspberry Pi Boot Time Optimization with systemd

The safest way to make a Raspberry Pi boot faster is to measure the critical path, change one service at a time, and confirm that the required application is actually ready sooner. Do not begin by copying a large list of config.txt, kernel, or service-disable tweaks from another system.

Quick answer: Raspberry Pi 5 boot time

Run systemd-analyze time, then systemd-analyze critical-chain on the Pi. Diagnose one boot first; collect five comparable boots per configuration when measuring an improvement. There is no universal normal Pi 4 or Pi 5 boot time, and the longest entry in blame is not automatically the cause of the delay.

Raspberry Pi slow boot: choose the right check

What you observe First check What it tells you
Pi boots, but startup feels slow systemd-analyze time The stages Linux/systemd can report, not necessarily power-on-to-ready time
A service appears slow systemd-analyze critical-chain and systemd-analyze blame Compare ordering with activation duration; do not add parallel times
Login works, but your application is late The application's unit and readiness check A running process is not necessarily ready to serve requests
You need the Pi to accept SSH after boot Check when the SSH server listens and when a client can log in Separates server startup from network and login readiness
A delay seems related to Wi-Fi or DHCP NetworkManager wait-online diagnosis Which consumer and connection actually need the wait
No login, boot loop or emergency mode Boot failure troubleshooting Recover the system before tuning startup

The commands in the next section are read-only and run on the Pi, locally or over SSH. You need a booted Linux installation using systemd. Do not reboot a remotely managed Pi just to follow the first diagnostic steps.

If the symptom is general slowness rather than startup delay, begin with the Raspberry Pi OS performance optimization guide. Memory pressure, failing storage, and thermal throttling need different measurements.

Quick workflow

# Overall userspace and kernel timing
systemd-analyze time

# Units ordered by activation time
systemd-analyze blame

# Dependencies that determined the critical path
systemd-analyze critical-chain

# Services that failed during this boot
systemctl --failed

# Boot warnings and errors
journalctl -b -p warning --no-pager

Use the results in this order:

  1. Define the event that means "ready" for your project.
  2. Record at least five cold boots before changing anything.
  3. Investigate units on critical-chain, not merely the longest line in blame.
  4. Disable or delay one confirmed-unused service.
  5. Reboot five times and compare the median.
  6. Restore the change if reliability or functionality regresses.

What counts as Raspberry Pi boot time?

systemd-analyze time separates firmware, loader, kernel, initrd, and userspace where those stages are available. Pair the report with a project-specific readiness check for your kiosk, API, camera, or network connection.

For an appliance, choose an application-level target such as:

  • SSH accepts a connection.
  • A worker completes its initial load and can accept a job.
  • An HTTP health endpoint returns 200.
  • A kiosk page is visible and interactive.
  • A GPIO output reaches its required state.

Measure both systemd startup and the readiness event your users need. Which target you choose depends on the job the Pi performs.

A real Pi 4 boot report: why the numbers differ

On our Raspberry Pi 4 Model B Rev 1.5, the diagnostic commands returned this report on 16 October 2026:

Startup finished in 2.516s (kernel) + 16.551s (userspace) = 19.068s
graphical.target reached after 10.375s in userspace.

These are different boundaries, not a contradiction. The target timestamp is relative to userspace startup. The overall startup report includes other activation work; neither line proves when a desktop became interactive or an SSH connection first succeeded. Firmware time was not reported here, so 19.068 seconds is not a measured power-on-to-desktop time.

The longest entry in blame was:

5.988s NetworkManager-wait-online.service

But the top of the reported desktop critical chain was:

1
2
3
4
5
graphical.target @10.375s
└─lightdm.service @10.138s +234ms
  └─systemd-user-sessions.service @10.076s +57ms
    └─network.target @10.064s
      └─NetworkManager.service @7.227s +2.835s

NetworkManager-wait-online.service was not in that displayed chain. Subtracting its 5.988 seconds from the desktop target would therefore be an unsupported prediction. It may still matter to another consumer; inspect that consumer's chain before changing anything. Read the network-wait diagnosis if that is your actual bottleneck.

This is one existing boot, inspected on Debian 13-based Raspberry Pi OS with kernel 6.18.50+rpt-rpi-v8. No service was disabled and no reboot or before/after speed test was performed. It is a worked interpretation, not a Pi 4 average, a Pi 5 result or a claim of a speedup.

Measure when SSH is ready

Use two observations for a headless Pi. First, find when the local SSH service started. Then measure when your client can authenticate and run a command. A successful login also depends on name resolution, the network path, and the credentials you use.

Read the Pi's current boot journal

Run this on the Pi. Raspberry Pi OS normally calls the OpenSSH unit ssh.service. Use the unit name on your image if it differs.

1
2
3
4
5
systemd-analyze critical-chain ssh.service
systemctl show ssh.service -p Type -p ActiveState -p ActiveEnterTimestampMonotonic
systemctl show network-online.target -p ActiveState -p ActiveEnterTimestampMonotonic
journalctl -b -u ssh.service --output=short-monotonic --no-hostname --no-pager \
  --grep='^Server listening|^Started .*ssh|^Started .*OpenBSD'

The --grep filter selects common English startup messages. If the filter finds nothing, inspect the unfiltered journal for that unit. ActiveEnterTimestampMonotonic is in microseconds on the current boot's monotonic clock. Divide by 1,000,000 to compare it with the seconds printed by journalctl --output=short-monotonic. If the unit restarted, that property may describe its latest activation. Check the sequence in the journal. Debian systemd journal reference

In a later boot on the same Pi 4, systemd reported ActiveEnterTimestampMonotonic=13696440 for ssh.service. The journal recorded the IPv4 listener at 13.696 s on the boot clock. On that clock, network-online.target activated at about 19.471 s. The earlier listener only establishes when the process was ready to accept connections at the server. Use a client-side login to measure reachability. The @ timestamps in a critical-chain report use the systemd startup timeline. Use one clock for any subtraction.

Check an authenticated SSH login from your computer

On a Linux client with Bash, OpenSSH and GNU timeout, replace my-pi with a verified host alias or user@hostname. Before measuring startup, run the snippet with the Pi already on to confirm that key authentication and host verification work. Keep the same address and connection path for all comparisons. Key setup on Raspberry Pi

(
  pi_ssh=my-pi
  wait_seconds=60
  SECONDS=0

  while (( SECONDS < wait_seconds )); do
    if last_error=$(timeout 4s ssh -n -T \
      -o BatchMode=yes -o ConnectTimeout=2 -o StrictHostKeyChecking=yes \
      -o ControlMaster=no -o ControlPath=none -- "$pi_ssh" true 2>&1); then
      printf 'SSH command succeeded %s s after starting the check.\n' "$SECONDS"
      exit 0
    fi
    sleep 1
  done

  printf 'SSH command did not succeed. Last result: %s\n' \
    "${last_error:-no SSH response before the attempt timed out}" >&2
  exit 1
)

Each attempt authenticates and runs true over a fresh connection. The check gives up after about a minute. A name lookup error, host key error or authentication error needs separate investigation before timing a boot. OpenSSH client options

For a planned boot comparison, use the same starting event for every run. For example, start this check at the moment you power on a fully shut-down Pi and note any delay between power-on and starting the command. Record the result as elapsed time from the client check. It samples readiness roughly once a second between attempts, so report seconds rather than millisecond precision.

Create a repeatable baseline

First save the current boot. The following creates a private report directory and a uniquely named text file; it does not change services or reboot:

if boot_report_dir=$(mktemp -d "$HOME/boot-bench.XXXXXX"); then
  {
    date --iso-8601=seconds
    uname -a
    cat /etc/os-release
    systemd-analyze time
    systemd-analyze critical-chain
    systemctl --failed
  } > "$boot_report_dir/report.txt" 2>&1
  cat "$boot_report_dir/report.txt"
fi

Keep the report locally: hostnames, unit names and OS details can identify your installation. Review and redact before sharing it. Repeat after each test boot and keep the reports with a note identifying the configuration.

For comparisons, distinguish a warm reboot from a cold start. Keep the same method in both groups. For a cold start, shut down cleanly and wait for shutdown to complete before disconnecting power; never pull power from a running filesystem to collect timings.

Keep these conditions constant:

Variable Record it because
Raspberry Pi model and RAM Firmware and hardware initialisation differ
Raspberry Pi OS release systemd units and desktop stack change
Storage device and filesystem SD, USB SSD, and NVMe latency differ
Power supply Undervoltage can distort results and cause failures
Connected USB/HAT hardware Device discovery may add delays
Network connection DHCP and online dependencies vary
Desktop or Lite image Graphical startup adds a different target

Check power and throttling history after each run:

vcgencmd get_throttled

A value other than 0x0 means a power, frequency-cap, or thermal condition is current or has occurred since boot. Fix that before treating the timing as a clean benchmark.

Read systemd-analyze correctly

systemd-analyze blame

blame lists how long units spent activating, but a slow unit may have run in parallel and contributed little to total boot time. Treat it as a clue, not a list of services to disable.

systemd-analyze blame --no-pager | head -30

systemd-analyze critical-chain

The critical chain shows ordering dependencies that held up the selected target:

1
2
3
systemd-analyze critical-chain
systemd-analyze critical-chain multi-user.target
systemd-analyze critical-chain graphical.target

The @ time shows when a unit became active or started on the reported timeline. The + time shows how long it took to start.

Both views have limits: Type=simple process startup does not measure application readiness, and device waits, timed-out jobs or socket activation may need journal inspection too. See the upstream systemd-analyze manual distributed with Debian.

If the command says bootup is not yet finished, inspect systemctl list-jobs --no-pager and the relevant unit's logs. Do not cancel every job to make the report finish. If it cannot connect to the bus, check whether you are inside a container or chroot rather than a booted Pi system.

Boot timeline plot

Generate an SVG for a visual comparison:

systemd-analyze plot > boot-before.svg

After a change, generate boot-after.svg and compare the critical path rather than the total number of enabled services.

Find the cause of a slow unit

For a unit named example.service, inspect its status, definition, dependencies, and current-boot logs:

1
2
3
4
systemctl status example.service
systemctl cat example.service
systemctl list-dependencies example.service
journalctl -b -u example.service --no-pager

Questions to answer before changing it:

  • Is the service required by the application?
  • Is it waiting for hardware, DNS, DHCP, storage, or another unit?
  • Does it fail and retry until a timeout?
  • Can the application start without waiting for it?
  • Is the unit enabled directly or pulled in by another target?

Fixing an error or timeout is generally more valuable than hiding the service.

Safe optimisation 1: disable a confirmed-unused service

Check why it is enabled and what depends on it:

systemctl is-enabled example.service
systemctl list-dependencies --reverse example.service

example.service is a placeholder, not a unit to paste literally. This example applies only to an ordinary, currently enabled, confirmed-unused service. Record its original enabled/active state and definition. Static, masked, generated or socket-triggered units need separate analysis. Never experiment on SSH, your network connection, storage or security maintenance merely to shorten a table.

For that restricted case, change next-boot enablement without stopping the running service immediately:

sudo systemctl disable example.service

disable does not guarantee that another dependency cannot start the service. It also differs from --now, which would stop it immediately. Review systemctl's enable/disable semantics before using these operations.

Only schedule a reboot after saving work and confirming a recovery console or known-good storage. Check SSH is active and enabled if it is your access method:

systemctl is-active ssh
systemctl is-enabled ssh

For the originally enabled service in this example, cancel the enablement change with:

sudo systemctl enable example.service

If a test reboot has already left it inactive, starting it is an additional explicit operation after reviewing its purpose. Re-enabling is not a universal restoration of every custom symlink or prior runtime state; keep the original configuration record.

Examples that may be unused on a specific appliance include Bluetooth support on an Ethernet-only server or a print service on a system that never prints. They are not universally safe to disable.

Safe optimisation 2: remove unnecessary network waiting

For NetworkManager-specific timeouts, profile retries, and rollback steps, use the NetworkManager wait-online slow-boot diagnosis guide.

A headless service may be ordered after network-online.target even when it can bind locally and retry its outbound connection later. Inspect the chain first:

systemd-analyze critical-chain network-online.target
systemctl list-dependencies --reverse network-online.target

Do not simply disable the wait-online service if the application requires a configured address or mounted network storage during startup. network-online.target does not guarantee DNS, a reachable remote endpoint, or a synchronised clock; verify those application requirements separately. Make the application resilient where appropriate:

  • Start after network.target when only the network stack is needed.
  • Retry remote connections with bounded backoff.
  • Expose readiness separately from process startup.
  • Keep network-online.target for services that truly require it.

Safe optimisation 3: make your own service precise

Avoid broad dependencies such as After=network-online.target when they are not needed. A simple local application can use:

[Unit]
Description=My Raspberry Pi application
After=local-fs.target

[Service]
Type=simple
ExecStart=/usr/local/bin/my-app
Restart=on-failure
RestartSec=2

[Install]
WantedBy=multi-user.target

After changing a unit:

1
2
3
4
sudo systemctl daemon-reload
sudo systemctl enable my-app.service
sudo systemctl restart my-app.service
systemctl status my-app.service

Use Type=notify only when the application actually sends the systemd readiness notification. Choosing a service type that does not match process behaviour can add timeouts or report false readiness.

Safe optimisation 4: use Raspberry Pi OS Lite

For SSH servers, gateways, and embedded applications that do not need a local graphical session, starting with Raspberry Pi OS Lite usually removes more work than manually dismantling a desktop installation.

Before migrating:

  1. Export application configuration and data.
  2. Record installed packages and enabled units.
  3. Prepare a second storage device rather than overwriting the working one.
  4. Reproduce the service and health check.
  5. Compare measured readiness and memory usage.

Keep the original storage as a rollback until the Lite installation has passed soak testing.

Safe optimisation 5: investigate storage

Slow or failing storage often appears as filesystem, database, or service delays. Check kernel messages and device health where supported:

journalctl -b -k --no-pager | grep -Ei 'mmc|nvme|usb|reset|timeout|error'
findmnt -no SOURCE,FSTYPE,OPTIONS /

Compare SD, USB SSD, or NVMe with the same OS image and workload. Do not publish a single boot result; use multiple cold boots and report the median plus the range.

See the Raspberry Pi benchmark methodology for a reproducible test record.

Changes to avoid copying blindly

The following frequently appear in old fast-boot guides but can create data loss, missing hardware, or an unbootable system:

Tweak Risk
Skipping filesystem checks with a fastboot kernel argument Hides a recovery mechanism and may leave corruption untreated
Overclocking SD timing Can cause intermittent I/O errors or corruption
Removing rootwait May fail when root storage is not ready
Disabling Wi-Fi, Bluetooth, I2C, SPI, audio, or camera in bulk Breaks attached hardware and services
Disabling swap on memory-constrained systems Can turn slow startup into out-of-memory failure
Disabling IPv6 globally Can delay or break modern network applications
Masking system units without dependency analysis Makes recovery harder than a reversible disable
Editing /boot/firmware/cmdline.txt across multiple lines Raspberry Pi expects the kernel command line on one line

Visual options such as quiet, splash settings, or hiding console output may change what users see without reducing real application readiness.

Benchmark table template

Variant Boot 1 Boot 2 Boot 3 Boot 4 Boot 5 Median App ready Failures
Baseline
Change A
Change B

Document the exact command or unit change for every row. If two changes are combined, you cannot tell which one helped.

Recovery checklist

If a change prevents normal startup:

  1. Connect a display and keyboard, or mount the boot/root filesystem from another Linux computer.
  2. Remove the most recent kernel or firmware edit using its backup.
  3. Boot into a rescue or emergency target if available.
  4. Re-enable the last disabled unit.
  5. Inspect the previous boot with journalctl -b -1.

For a service change:

1
2
3
sudo systemctl unmask example.service
sudo systemctl enable example.service
sudo systemctl daemon-reload

Keep a known-good storage image for devices that must recover without network access.

FAQ

What is a normal Raspberry Pi boot time?

There is no single useful number. Model, firmware, storage, OS image, attached hardware, network, and the definition of "ready" all matter. Compare the same device against its own repeatable baseline.

Why is a service high in systemd-analyze blame but not in critical-chain?

It probably started in parallel with other work. Reducing its activation time may lower resource contention, but it may not shorten the overall critical path.

Can Raspberry Pi boot in under 10 seconds?

Some minimal, purpose-built systems can, but the number is meaningless without the measurement boundary and hardware details. Measure your application-ready event and preserve required functionality.

Should I disable NetworkManager-wait-online.service?

Only after checking reverse dependencies and confirming that no required service needs a fully configured network at startup. A better fix may be to remove an unnecessary dependency from your own service.

Does NVMe always boot faster than microSD?

Not always. Device initialisation, controller behaviour, filesystem, random I/O, and services all contribute. Measure both configurations on the same board and OS image.

Donate