---
type: Article
title: "Install snmpd on CentOS/RHEL"
description: "Install snmpd on CentOS, RHEL, Rocky or AlmaLinux: pull net-snmp with the package manager, drop your snmpd.conf, and start the service. Same daemon as Debian."
resource: "https://snmp-monitoring.com/setup/centos-rhel/"
tags: [setup, snmp]
timestamp: 2026-07-13T00:00:00Z
---

# Install snmpd on CentOS/RHEL

If you already know how to install snmpd on Ubuntu, doing it on the Red Hat side is the same idea with different plumbing. To install snmpd on CentOS or RHEL you pull the Net-SNMP package with the system package manager, drop your config into `/etc/snmp/snmpd.conf`, and start the service. The daemon, the config file, the OIDs it serves, and the query tools are all identical to a Debian box — only the install command and a couple of file paths differ. This page walks the whole thing end to end for the Red Hat family: CentOS, RHEL, Rocky, and AlmaLinux behave the same way here.

## Prerequisites

Not much stands between you and a running agent on snmp rhel systems:

- A **CentOS, RHEL, or compatible** host (Rocky/AlmaLinux included) that you can reach over the network.
- **Root or sudo** — installing packages and editing `/etc/snmp/snmpd.conf` both need it.
- Network reachability to your package mirrors so the package manager can fetch **Net-SNMP**.
- A plan for a **read-only community string** and the OIDs you intend to expose. Sketch those with the [OID allowlist guide](/setup/oid-allowlist.md) before you open the config.
- The **Net-SNMP client tools** to test — the utilities package ships `snmpget`, `snmpwalk`, and `snmptable`. More on those in the [Net-SNMP toolkit](/tools/net-snmp.md).

Because the steps run so close to the Debian/Ubuntu path, the [install snmpd on Ubuntu/Debian](/setup/install-snmpd-ubuntu-debian.md) page is a useful companion — the config and verification are word-for-word the same.

## Step-by-step

The flow is: install, configure, enable, open the firewall, test. Here it is for CentOS/RHEL.

1. **Install the daemon and utilities.** On older CentOS/RHEL the package manager is `yum`; on current releases it's `dnf` (the commands are interchangeable). A `yum install net-snmp` pulls the agent; add the utilities package for the client tools:
   ```bash
   sudo yum install net-snmp net-snmp-utils
   ```
   (On modern RHEL, `sudo dnf install net-snmp net-snmp-utils` is the same operation.)
2. **Back up the stock config**, then start clean:
   ```bash
   sudo cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig
   ```
3. **Write your v2c read-only config** into `/etc/snmp/snmpd.conf` (full example in the next section). This file lives at the same path as on Debian, so the contents are portable.
4. **Enable and start the service.** The daemon is `snmpd`. Using the portable service wrapper:
   ```bash
   sudo service snmpd restart
   ```
   On systemd-based RHEL you can equivalently enable-at-boot and start with the systemd tooling; the effect is the same running agent.
5. **Open the SNMP port in the firewall.** Red Hat systems typically run firewalld, so allow the SNMP UDP port (161 by default) through it. If you've moved to a custom port, allow that number instead — see [set a custom SNMP port](/setup/custom-port.md).

That's the entire install. Note what did *not* change from the Debian instructions: the config syntax, the OIDs, the `snmpwalk`/`snmpget` commands, and the security model are all standard Net-SNMP. The Red Hat differences are narrow — the `yum`/`dnf` install line above, and the location of the daemon's options file. On Debian that's `/etc/default/snmpd`; on the Red Hat family the equivalent options file is generally `/etc/sysconfig/snmpd` on builds that use one. If you don't need to pass extra launch flags, you can ignore it entirely and let the defaults ride. When in doubt about a Red Hat-specific detail, treat the [/etc/default/snmpd guide](/setup/default-snmpd-daemon.md) as the conceptual reference and apply the same idea to the sysconfig path.

## Configuration example

The same steps map cleanly from Debian/Ubuntu to CentOS/RHEL:

| Task | Debian/Ubuntu | CentOS/RHEL |
|---|---|---|
| Install package | `apt-get install snmpd` | `yum install net-snmp` (or `dnf install net-snmp`) |
| Config file | `/etc/snmp/snmpd.conf` | `/etc/snmp/snmpd.conf` |
| Manage service | `service snmpd restart` | `systemctl restart snmpd` |
| Check status | `service snmpd status` | `systemctl status snmpd` |


The config is identical to any other Net-SNMP host — this is the portable part. A minimal v2c, read-only, allowlisted `/etc/snmp/snmpd.conf`:

```bash
# /etc/snmp/snmpd.conf — v2c read-only, allowlisted OIDs
agentAddress udp:161,udp6:[::1]:161        # change 161 to a random port for security

#       sec.name    source    community
com2sec ReadUser    default   <password>

#       group        sec.model  sec.name
group   ReadGroup    v2c        ReadUser

#       view         incl/excl  subtree
view    ReadData     included   .1.3.6.1.2.1.25.1.1.0
view    ReadData     included   .1.3.6.1.2.1.25.3.3.1.2
# ...one 'view ... included' line per allowed OID...

#       group        context  model  level   prefix  read      write  notify
access  ReadGroup    ""       any    noauth  exact   ReadData  none   none
```

Set `<password>` to a long random string, then add one `view ... included` line per OID you want reachable. Those two shown expose host uptime (`1.3.6.1.2.1.25.1.1.0`) and CPU load (`1.3.6.1.2.1.25.3.3.1.2`) from the Host Resources MIB (RFC 2790). Add memory, storage, and system-load OIDs the same way — the [sensor catalog](/sensors/index.md) lists each. Keep write and notify at `none`; this agent only answers reads.

![Terminal on CentOS running yum install net-snmp then editing /etc/snmp/snmpd.conf to install snmpd centos](https://snmp-monitoring.com/img/setup/install-snmpd-centos-terminal.webp)

## Verify it works

Confirm the service is up, then prove it answers. Status first:

```bash
service snmpd status
```

Look for an active/running state. Then query the agent locally:

```bash
snmpget -v2c -c <community> localhost 1.3.6.1.2.1.25.1.1.0
```

A `TimeTicks` uptime value means the install and config are good. Walk a table to see more than one row come back:

```bash
snmpwalk -v2c -c <community> localhost 1.3.6.1.2.1.25.3.3.1.2
```

That returns one `hrProcessorLoad` line per CPU. Finally, test from another machine using the server's IP to confirm the firewall is letting SNMP through — a local success but a remote timeout means the firewalld rule for the UDP port is missing or wrong. Anything stubbornly silent is covered in the [troubleshooting guide](/setup/troubleshooting.md).

## Security note

A default Net-SNMP install is not hardened. On RHEL, tighten it before it faces anything:

- **Replace any default community.** Never leave `public` in place — use a long, random read-only string. See [secure the community string](/setup/secure-community-string.md).
- **Allowlist OIDs.** Expose only what you monitor; deny the rest with a tight `view`, per the [OID allowlist](/setup/oid-allowlist.md).
- **Scope the firewalld rule** to the hosts that actually poll, not the whole internet.
- **Move off UDP 161** to a random high port to cut scanner noise — [custom port](/setup/custom-port.md).
- **Use SNMPv3** where you need authentication and encryption; v2c sends the community in clear text (RFC 1901).

The full picture is in the [security section](/security/index.md).

## Next: connect external monitoring

A freshly installed agent on CentOS still has the same blind spot every local monitor has: if the server crashes, whatever runs on it to warn you crashes too. Watching from outside removes that dependency. An independent poller keeps checking your agent from another network and turns a dead host into an alert instead of a gap in the graph — the essence of [double durability](/monitoring/double-durability.md), where a second, independent source catches what the first can't report.

[ostr.io Monitoring](https://ostr.io/service/monitoring) polls the OIDs your CentOS/RHEL agent exposes from outside your network and sends real-time email and SMS alerts on outages, slow responses, and resource spikes — no extra software on the box. When the agent's verified, [add an SNMP endpoint in ostr.io](/setup/add-endpoint-ostrio.md).

![Diagram of an external monitor polling a CentOS/RHEL SNMP agent over UDP and sending alerts](https://snmp-monitoring.com/img/setup/centos-external-snmp.webp)

## FAQ

**Is it `yum` or `dnf` to install snmpd on CentOS/RHEL?**
Both work. Older CentOS/RHEL 7 uses `yum install net-snmp net-snmp-utils`; RHEL 8+, Rocky, and AlmaLinux use `dnf`, which accepts the same arguments. On current systems `yum` is often a symlink to `dnf`, so the command you already know still runs.

**Where's the config file on RHEL — is it different from Ubuntu?**
No. `/etc/snmp/snmpd.conf` is the same path on both. The community, group, view, and access syntax are standard Net-SNMP and fully portable. Only the daemon's launch-options file differs: Debian uses `/etc/default/snmpd`, and the Red Hat equivalent is generally `/etc/sysconfig/snmpd`.

**Why can I query snmpd locally but not from another server?**
The firewall. Red Hat systems commonly run firewalld with SNMP closed by default, so a local `snmpget` succeeds while a remote one times out. Allow the SNMP UDP port (161, or your custom port) through firewalld to the hosts that poll.

**Do I need the utilities package if I only run the agent?**
Not strictly — `net-snmp` provides the daemon on its own. But the utilities package gives you `snmpget`, `snmpwalk`, and `snmptable` for testing, and verifying the agent locally is worth the small install.

## Conclusion

To install snmpd on CentOS or RHEL: pull Net-SNMP with `yum install net-snmp` (or `dnf`), write a v2c read-only config into `/etc/snmp/snmpd.conf`, enable the `snmpd` service, and open the SNMP UDP port in firewalld. The config, OIDs, and query commands are identical to the Debian/Ubuntu path — only the package manager and the options-file location differ. Verify with `snmpget` locally and remotely, harden the community and OID view, then let an external monitor watch it so a downed server still raises the alarm.
