N100Firewall
Isometric pink square frame standing on a dark platform, linked by glowing lines to small pink disc nodes, suggesting firewall hardware and network traffic
hardware

How Much RAM for OPNsense Firewall Builds? 4, 8 or 16 GB

OPNsense installs on 3 GB, but 8 GB is the right buy for most home firewalls. Here is what Zenarmor, Suricata and ZFS cost, and when to buy 16 GB.

By N100Firewall Editorial · · 8 min read

The short answer to how much RAM for OPNsense firewall hardware is 8 GB. That is OPNsense’s own recommended specification, with room for NAT, Unbound, WireGuard, a ZFS install and one heavy service such as Suricata or Zenarmor. 4 GB still runs a plain router. Buy 16 GB only when Zenarmor’s local reporting and Suricata share one box, or past 250 devices.

RAM does not track WAN speed. It tracks what you switch on: inspection engines, reporting databases, alias tables and the filesystem cache. “Just get 16 GB” is a habit, not a sizing method, and each of those consumers has a documented cost. If the hardware is not chosen yet, the Intel N100 firewall build guide covers NICs and storage alongside memory.

How much RAM does OPNsense officially require?

Three tiers: 3 GB minimum, 4 GB “reasonable” and 8 GB recommended. OPNsense’s hardware sizing page adds that the installer itself needs at least 3 GB of memory, which rules out 2 GB boards even for a bare install.

TierCPURAMStorageThroughput bandUsersFeatures
Minimum1 GHz dual-core3 GB4 GB SD/CF, nano image11–150 Mbps10–30Reduced
Reasonable1 GHz dual-core4 GB40 GB SSD151–350 Mbps30–50All
Recommended1.5 GHz multi-core8 GB120 GB SSD350–750+ Mbps50–150+All

Treat the throughput column as a proxy for how busy the network is, not a memory formula. The same page gives the real per-connection cost: about 1 kB of RAM per state-table entry, so 1,000 states occupy about 1 MB. The minimum row assumes the nano image with logs in RAM, an embedded profile rather than a new build.

What actually uses RAM on an OPNsense firewall?

Five consumers matter: the pf state table, alias and blocklist tables, the inspection engine, Zenarmor’s reporting database and the ZFS ARC. Unbound and the base system are small beside them; Unbound’s upstream defaults are a 4 MB message cache and a 4 MB RRset cache, per unbound.conf(5). Several figures below come from Netgate’s pfSense documentation, which describes the same FreeBSD pf and ZFS stack.

ConsumerDocumented figure
pf state tableAbout 1 kB per state; 100,000 states is about 100 MB
Alias and blocklist tablesAbout 1 kB per entry, conservatively; must fit twice during a reload
Suricata or Snort1 GB minimum; 2 GB or more for some configurations, before OS and states
Zenarmor engine1 GB minimum
Zenarmor plus local ElasticsearchAt least 8 GB of system RAM
ZFS ARC, automatic maximumHalf of RAM or RAM minus 1 GB, whichever is greater

States are cheap. Netgate’s hardware sizing guidance uses the same 1 kB figure and puts 100,000 states at roughly 100 MB, a rounding error on 8 GB. OPNsense shows its default for Firewall Maximum States in that setting’s help text, per its firewall settings documentation.

Tables are where blocklists bite. Netgate’s notes on firewall maximum table entries warn that alias data must fit twice over during a reload, because the new list loads before the old one is dropped. pfSense defaults to a 400,000-entry ceiling; at 1 kB each, that is about 400 MB, or 800 MB mid-reload. Stacked GeoIP country aliases and IP blocklists are how a home ruleset grows toward it. OPNsense exposes the same limit as Firewall Maximum Table Entries and suggests raising it “when using a lot of large aliases.”

Inspection is the big step. Netgate budgets 1 GB minimum for Snort or Suricata, and 2 GB or more for some configurations, “not counting RAM used by the operating system, firewall states, and other packages.” OPNsense’s IPS is Suricata running inline over netmap, per the OPNsense IDS/IPS manual, so plan with Netgate’s number and expect it to move with every rule category you enable.

Zenarmor scales with devices and with its database. The Zenarmor hardware requirements set minimum memory by active device count:

Active devicesMax WAN bandwidthMinimum RAM
0–50300 Mbps1 GB
50–100500 Mbps4 GB
100–2501 Gbps8 GB
250–1,0001–2 Gbps16 GB
1,000–2,0001–2 Gbps32 GB

The footnote outweighs the table: Zenarmor says you need at least 8 GB of RAM to run Elasticsearch alongside it. A 30-device household sits on the 1 GB row, but with local Elasticsearch reporting it is an 8 GB box. Offloading the reporting database to an external system is the documented route on low-memory hardware.

Why does OPNsense show so much memory in use on ZFS?

Because the ZFS ARC, the in-RAM read cache, is allowed to grow large by default. Netgate’s ZFS tuning page gives the automatic maximum as half of RAM or total RAM minus 1 GB, whichever is greater: 7 GB on an 8 GB firewall. A high dashboard percentage on a ZFS install is usually cache, not a leak.

The FreeBSD Handbook documents vfs.zfs.arc.max as the ARC’s upper bound, where the default of 0 lets ZFS size it from installed memory. A firewall gets little from a large read cache, which is Netgate’s argument for tuning it down; its conservative advice on low-RAM systems is a cap of 25% of total RAM or less. Add it under System ‣ Settings ‣ Tunables, in bytes:

Installed RAM25% capvfs.zfs.arc.max value
4 GB1 GB1073741824
8 GB2 GB2147483648

Reboot so the cache starts under the new ceiling. Cap it on 4 GB hardware, or on 8 GB when Zenarmor’s Elasticsearch runs locally; on 16 GB, leave the default. Do not dodge ARC pressure by reinstalling on UFS. The OPNsense install and first-boot guide explains why ZFS boot environments are worth keeping.

4 GB, 8 GB or 16 GB: which should you buy?

Buy 8 GB unless your plan clearly matches the 4 GB or 16 GB rows below. Each row follows from the documented figures above.

ProfileWhat runs on itBuy
Plain routerNAT, Unbound, WireGuard, 2–4 VLANs, no inspection4 GB works; 8 GB if buying new
Typical home firewallThe above plus ZFS, IP blocklists, and Suricata or Zenarmor for up to 250 devices8 GB
Everything on one boxZenarmor with local Elasticsearch plus Suricata, large GeoIP and blocklist tables16 GB
Small office250 to 1,000 devices under Zenarmor16 GB
Larger site1,000 or more devices under Zenarmor32 GB, so not an N100

On an N100, 16 GB is also the ceiling. Intel’s N100 specification lists a 16 GB maximum on a single memory channel, DDR4-3200, DDR5-4800 or LPDDR5-4800, with no ECC support. With one channel, a single module is the normal configuration, not a compromise. Check whether a box uses a SO-DIMM slot or soldered memory before ordering; the fanless N100 mini PC picks cover what to confirm with the vendor.

None of the OPNsense, Netgate or Zenarmor sizing tables specifies memory speed, so buy capacity, not MT/s. RAM also adds no packet-processing cores; Suricata throughput on four N100 cores is a CPU question, covered in OPNsense vs pfSense on an N100. If the plan needs 16 GB and heavy inspection at once, check the N100 vs N305 vs N5105 comparison first.

How do you check whether OPNsense needs more RAM?

Check swap, ARC size and state count from a shell, either console option 8 or SSH. If swap is near zero and the ARC still has room to shrink, the box does not need more memory, whatever the dashboard percentage says.

# Memory summary; ZFS installs show an ARC line
top -b -o res | head -n 20

# Current ARC size and configured cap, in bytes
sysctl kstat.zfs.misc.arcstats.size vfs.zfs.arc.max

# Swap in use
swapinfo -h

# Current pf states, then limits for states, frags and table entries
pfctl -si | grep -i entries
pfctl -sm

# Processes killed for lack of memory
dmesg | grep -i "out of swap"
  • Swap filling, ARC large: cap vfs.zfs.arc.max. Netgate calls a little swap beside a big ARC normal, but high or nearly full swap means real contention.
  • Swap filling, ARC already small: add RAM, or move Zenarmor’s reporting database off the box.
  • States near the pfctl -sm limit: raise Firewall Maximum States and budget about 1 kB per extra state.
  • Any “out of swap” kill: the killed service needs memory it did not get; size up before re-enabling it.

Run the set once before enabling Suricata or Zenarmor and again after, with normal traffic flowing. The difference is what inspection costs on your ruleset, which no sizing table can tell you.

FAQ

Is 4 GB of RAM enough for OPNsense?

Yes, for a plain router. OPNsense lists 4 GB as its reasonable tier, which supports the full feature set at moderate load. It gets tight once Suricata, local Zenarmor reporting or an uncapped ZFS ARC joins in, so on 4 GB hardware set vfs.zfs.arc.max to 1 GB, enable the swap file and keep inspection rule categories lean.

Does OPNsense need ECC RAM?

No. None of OPNsense’s hardware tiers calls for ECC memory, and Intel’s specification lists the N100 without ECC support, so the question does not arise on these boxes. A firewall’s configuration is one XML file you can back up, and its state table starts empty after every reboot, which makes ECC a lower priority than on a storage server.

Should I enable swap on OPNsense?

Enable it on 4 GB hardware and treat it as a safety net elsewhere. OPNsense’s Miscellaneous settings can create a 2 GB swap file, which the documentation says can increase performance at the cost of storage wear, especially on flash. A little swap use beside a large ZFS ARC is normal; swap that keeps filling means cap the ARC or add RAM.

How much RAM should an OPNsense VM get?

Size an OPNsense VM like bare metal: 4 GB for routing and VPN, 8 GB once Suricata or Zenarmor runs, and never less than the 3 GB the installer needs. Use a fixed allocation rather than ballooning, and cap the ZFS ARC inside the guest, since a firewall gains little from a large read cache.

Sources

  1. Hardware Sizing & Setup (OPNsense Documentation)
  2. Zenarmor Hardware Requirements for OPNsense (Zenarmor Documentation)
  3. Zenarmor (Sensei): Hardware Requirements (OPNsense Documentation)
  4. Hardware Sizing Guidance (pfSense Documentation, Netgate)
  5. ZFS Tuning (pfSense Documentation, Netgate)
  6. Advanced Configuration: Firewall & NAT (pfSense Documentation, Netgate)
  7. The Z File System (FreeBSD Handbook)
  8. Intel Processor N100 Specifications (Intel)
  9. Intrusion Prevention System (OPNsense Documentation)
  10. Firewall Settings (OPNsense Documentation)
  11. Settings: Tunables and Miscellaneous (OPNsense Documentation)
  12. unbound.conf(5) (NLnet Labs Unbound Documentation)
#opnsense #ram-sizing#zenarmor#suricata#zfs #intel-n100

Related