# Server Groups

Source: https://docs.ops0.com/docs/servers/groups

Server Groups let you organize your [Servers](https://docs.ops0.com/docs/servers/overview) fleet into logical collections — by environment, function, or team — so you can manage and target them together instead of one at a time.

---

## What are Server Groups?

A Server Group is a named collection of servers with an optional description and an optional **default PEM key**. Groups exist to:

- Keep large server fleets organized (e.g. "Production Web Servers", "Staging DB Servers")
- Provide a default SSH key so new servers in the group don't each need one selected manually
- Act as a single target when creating an Ansible [Configurations](https://docs.ops0.com/docs/configurations/ai-generator) project, instead of picking individual servers

---

## Creating a Server Group

### Open Server Groups
Navigate to the **Server Groups** tab.

### Click Create Group
Click **Create Group**.

### Enter Details
Provide a **Group Name** and an optional **Description**.

### Set a Default PEM Key (Optional)
Choose a **Default PEM Key**. This key is used by default for new Linux servers added to this group.

### Save
Click **Save** to create the group.

---

## Server Group Fields

| Field | Description |
|-------|-------------|
| **Name** | Display name of the group |
| **Description** | Optional free-text description of the group's purpose |
| **Default PEM Key** | SSH key applied by default to new Linux servers placed in this group |
| **Server Count** | Number of servers currently in the group |
| **Created** | Date the group was created |

---

## Group Card

Each group card in the grid shows the group name and description, its default PEM key (if set), the number of servers it contains, and a preview of up to three member servers with their status indicator and IP address (with a "+N more" note if there are more).

---

## Managing Group Membership

![ops0 Manage Servers dialog showing servers in a group and available servers to add](https://docs.ops0.com/images/server-groups-manage.png)

### Open Manage Servers
Click the server icon on a group card to open **Manage Servers** for that group.

### View Servers in Group
The left panel lists servers currently in the group, each with a **Remove** action.

### View Available Servers
The right panel lists ungrouped servers, each with an **Add** action.

### Add or Remove
Click **Add** to move an available server into the group, or **Remove** to take a server out of the group (it becomes ungrouped, not deleted).

### Done
Click **Done** to close the dialog.

**One group per server**

A server can belong to at most one Server Group at a time. Adding a server to a group updates its `groupId`; removing it clears that assignment.

---

## Ungrouped Servers

Servers that have not been assigned to any group are listed separately in an **Ungrouped Servers** section below the groups grid, so you can quickly spot servers that still need to be organized.

---

## Group Actions

| Action | Description |
|--------|-------------|
| **Manage Servers** | Open the add/remove membership dialog |
| **Edit** | Update the group's name, description, or default PEM key |
| **Delete** | Remove the group (with a confirmation prompt) |

---

## Using Groups in Configurations

When creating a new Ansible [Configuration project](https://docs.ops0.com/docs/configurations/ai-generator), you choose a **Target Infrastructure** mode of either **Server Group** or **Individual Servers**. Selecting **Server Group** lets you target every server in that group as the deployment target for generated playbooks, without picking each server individually.

---

## Next Steps

- [Servers Overview](https://docs.ops0.com/docs/servers/overview): Add and manage individual SSH and WinRM servers

- [AI Configuration Generator](https://docs.ops0.com/docs/configurations/ai-generator): Generate Ansible playbooks targeting a server group
