The Handbook

    Theme
    • Guides
        • Check a system before installing FreeBSD
        • Orient a Linux administrator on FreeBSD
        • Supported FreeBSD releases
        • Choose a FreeBSD documentation and support channel
        • Move files safely without GNU mv -t
        • Update, upgrade, or update packages?
        • Upgrade 14.4 or 15.0 to FreeBSD 15.1
        • Choose packages, ports, or poudriere
        • Choose the quarterly or latest package branch
        • Choose a FreeBSD download or package mirror
        • Make a system setting persistent
        • Configure locale, keyboard, and time zone
        • Configure a serial console for recovery
        • Choose a custom kernel, module, or loader setting
        • Run a Linux binary with the compatibility layer
        • Check desktop and laptop hardware before installation
        • Choose and check a graphics driver
        • Choose Xorg or Wayland
        • Build a maintainable desktop baseline
        • Install and check a desktop browser
        • Check laptop Wi-Fi, power, and suspend
        • Check multimedia readiness
        • Choose and configure a printing stack
        • Run Windows applications with Wine
        • Snapshot and replicate a ZFS dataset
        • Choose a filesystem and storage layout
        • Operate ZFS without losing the recovery path
        • Restore files from a ZFS snapshot
        • Read ZFS pool health and run a scrub
        • Replace a failed device in a ZFS mirror
        • Replicate a ZFS dataset over SSH
        • Change PF safely on a remote host
        • Configure a narrow WireGuard tunnel
        • Plan a FreeBSD home server
        • Choose a mail server or an outgoing relay
        • Publish a network service safely
        • Choose a jail network model
        • Choose native jails or a jail manager
        • Choose a jail or a bhyve virtual machine
        • Establish a FreeBSD security baseline
        • Choose a MAC policy
        • Audit security-relevant activity
        • Start a DTrace performance investigation
    • Integrations
        • Create a first jail with Bastille
        • Compare jail managers and OCI tooling
        • Publish a Bastille service through PF
        • Mount a ZFS dataset in a Bastille jail
        • Update and upgrade Bastille jails
        • Back up and restore a Bastille jail
        • Prepare bhyve and vm-bhyve
        • Choose NFS or Samba for file sharing
        • Choose ZFS backup automation
        • Operate a signed poudriere repository
        • Manage FreeBSD configuration with Ansible or Salt
        • Run Motion with webcamd on FreeBSD
        • Design a reverse proxy, certificates, and monitoring
    • FAQ
    • Troubleshooting
        • Recover an interrupted freebsd-update run
        • Resolve a package repository or ABI mismatch
        • Diagnose the FreeBSD boot path
        • Recover with a ZFS boot environment
        • Diagnose DNS, routing, and firewall paths
        • Diagnose network mbuf exhaustion
        • Bind a service to a low port without running it as root
        • Diagnose audio output or input
        • Diagnose webcamd, cuse, and a webcam
        • Fix USB device permissions without opening every device
    • About this handbook
    • Synopsis
    • Identify the setting type
    • Test a writable sysctl
    • Configure an rc service
    • Configure a loader tunable
    • Verify after reboot
    • Primary references

    Make a system setting persistent

    Last reviewed
    13 August 2026
    Applies to
    15.1-RELEASE, 15.0-RELEASE, 14.4-RELEASE

    Synopsis #

    FreeBSD settings are applied at different stages of startup. A runtime kernel parameter normally belongs in /etc/sysctl.conf; a loader tunable or kernel module belongs in /boot/loader.conf; and service or system startup configuration belongs in /etc/rc.conf. The same-looking assignment is not interchangeable between these files.

    Identify the setting type #

    Use the narrowest applicable mechanism:

    Setting Temporary check or change Persistent file or tool
    Runtime kernel state exposed by sysctl sysctl name or sysctl name=value /etc/sysctl.conf
    Loader tunable needed before the kernel completes startup Inspect loader documentation /boot/loader.conf
    Service enablement and rc variables service name status sysrc and /etc/rc.conf

    A tunable documented only for the loader should not be placed in sysctl.conf. A writable sysctl should not be moved to loader.conf merely because both files use name=value syntax.

    Test a writable sysctl #

    Read the current value and its description:

    $ sysctl kern.ipc.soacceptqueue
    $ sysctl -d kern.ipc.soacceptqueue
    

    If the setting is documented as writable, test the proposed value as root:

    # sysctl kern.ipc.soacceptqueue=256
    

    Measure the result before making it persistent. To apply the tested value during normal system startup, add an assignment to /etc/sysctl.conf:

    kern.ipc.soacceptqueue=256
    

    This value is only an example of file syntax, not a general tuning recommendation. Keep the system default unless a measured workload and primary documentation justify a change.

    Configure an rc service #

    Use sysrc instead of editing routine service assignments by hand. For example, enabling the SSH daemon writes the appropriate value to rc.conf:

    # sysrc sshd_enable=YES
    # service sshd start
    

    Enabling a service controls future startup; it does not necessarily start the service immediately. Starting a service does not necessarily enable it for the next boot.

    Configure a loader tunable #

    Confirm in the relevant manual page that a value is a loader tunable or that a module must load before startup completes. Add only that documented assignment to /boot/loader.conf, then reboot during a maintenance window.

    An invalid loader setting can affect boot. Keep access to the boot loader menu or system console so the assignment can be bypassed or corrected.

    When the proposed change is described as a kernel option, first use Choose a custom kernel, module, or loader setting to determine whether GENERIC plus a loadable module or documented tunable preserves a simpler update and recovery path.

    Verify after reboot #

    After the next reboot, repeat the read-only command used before the change. For services, check both the saved configuration and current state:

    $ sysrc sshd_enable
    # service sshd status
    

    Primary references #

    • FreeBSD Handbook: Configuration, Services, Logging and Power Management
    • sysctl(8)
    • sysctl.conf(5)
    • loader.conf(5)
    • rc.conf(5)
    • sysrc(8)

    Independent documentation. Not affiliated with or endorsed by the FreeBSD Project or the FreeBSD Foundation.

    Report a bug
    • Synopsis
    • Identify the setting type
    • Test a writable sysctl
    • Configure an rc service
    • Configure a loader tunable
    • Verify after reboot
    • Primary references