---
title: "How to Create Security Groups for Public Cloud [New]"
description: "0:00 2:47 [*This article is intended for customers using our New Public Cloud Platform. For articles covering our old Public Cloud offering, please check here.*](https://kb.leaseweb.com/kb/public-cloud/) This article explains how to create and configure a security group for your Public Cloud…"
url: "https://kb.leaseweb.com/kb/public-cloud-new/how-to-create-security-groups-for-public-cloud-new/"
updated: "2026-08-05"
category: "Products / Public Cloud [New]"
tags:
  - add security group
  - attach security group
  - firewall
  - public cloud
  - public cloud firewall
  - security groups
---

# How to Create Security Groups for Public Cloud [New]

0:00  2:47        [*This article is intended for customers using our New Public Cloud Platform. For articles covering our old Public Cloud offering, please check here.*](https://kb.leaseweb.com/kb/public-cloud/)

This article explains how to create and configure a security group for your Public Cloud Instances.

![idea e1761126179182](https://kb.leaseweb.com/wp-content/uploads/2025/10/idea-e1761126179182.png) A security group acts as a virtual firewall for your Public Cloud instances, allowing you to control inbound and outbound traffic.

## Prerequisites

- Access to the [Customer Portal](https://secure.leaseweb.com/dashboard/) account
- Enabled Leaseweb Public Cloud account.

## Steps to Follow

1. **Log in to the Customer Portal**

- Open your browser and go to the [Customer Portal](https://secure.leaseweb.com/dashboard/).
- Sign in with your Leaseweb account credentials.

1. **Navigate to Security Groups**

- From the left-hand menu, go to **Public Cloud**.
- Under the submenu, click **Security Groups**.
  - You will see a list of all available security groups within the current region

![Screenshot 2026 06 10 at 11.09.16](https://kb.leaseweb.com/wp-content/uploads/2026/06/Screenshot-2026-06-10-at-11.09.16-1024x479.png)

1. **Create a New Security Group**

- Click the **Create Security Group** button.
- Fill in the details:
  - **Name:** Provide a descriptive name (e.g., `web-frontend-sg`).
  - **Description:** Briefly explain the purpose (e.g., "Allows HTTP/HTTPS traffic for web servers").
  - **Stateful:** The system remembers the traffic that has been allowed and automatically authorizes the return flow without needing to configure an explicit rule in the opposite direction.

![Screenshot 2026 06 10 at 11.14.31](https://kb.leaseweb.com/wp-content/uploads/2026/06/Screenshot-2026-06-10-at-11.14.31-1024x490.png)

[Back to the top ↑](#top)

1. **Add Firewall Rules**

- Click on the security group, to access the security group details.
- Click **+ New Firewall Rule**.
  - A pop-up window will appear
- Select the **Protocol** from the dropdown (TCP, UDP, ICMP, or ALL)
- Enter:
  1. **Direction:** Select ingress or egress traffic direction.
  2. **Source Network:** Define the IP/CIDR that can access. 
- Click Save to add the rule.

![Screenshot 2026 06 10 at 15.04.46](https://kb.leaseweb.com/wp-content/uploads/2026/06/Screenshot-2026-06-10-at-15.04.46-1024x599.png)

1. **Save the Security Group**

- Once you’ve added the necessary rules, click **Create Group**.
  - Your new security group will now appear in the list

![image 2](https://kb.leaseweb.com/wp-content/uploads/2025/10/image-2-1024x121.png)

## How to Attach a Security Group While Launching an Instance

1. Navigate **to Public Cloud -> Instances**
2. Launch a New Instance:
   1. Click **Launch an Instance**.
   2. Enter a name for your instance.
   3. Select an OS image.
   4. Choose an instance type.
3. Attach a Security Group:
   1. In the Security Groups section, click **Attach Groups**.
   2. Select a security group that has already been created.
   3. Click **Confirm**.
      - Your selected security group will now be attached to the instance.
4. Continue with the remaining steps to launch your instance.

## How to Attach a Security Group to an Existing Instance

1. Go to your **Instance Details** page.
2. Navigate to the **Security** tab.
3. **Stop** the instance if it is currently running
   - **![warning e1759326998735](https://kb.leaseweb.com/wp-content/uploads/2024/12/warning-e1759326998735.png) *Security group changes can only be applied when the instance is stopped***.
4. Click on **Attach Security Groups**:
   1. A list of available security groups will appear.
   2. You can select one or multiple groups to attach.
   3. Already attached groups will be marked as selected or greyed out.
5. After choosing the desired security groups, click **Confirm**to apply the changes.

![Screenshot 2026 06 10 at 15.09.38](https://kb.leaseweb.com/wp-content/uploads/2026/06/Screenshot-2026-06-10-at-15.09.38-1024x338.png)

[Back to the top ↑](#top)

## How to Remove Security Groups from an Instance

1. Go to your **Instance Details** page.
2. Navigate to the **Security** tab.
3. Select the security groups you want to remove.
4. Click **Detach** Selected Security Group(s).
   - A confirmation message will appear: *“Are you sure you want to detach the selected Security Groups?”*
5. Confirm by clicking **Detach** again.
6. The selected security groups will be removed from your instance.

![Screenshot 2026 06 10 at 15.11.52](https://kb.leaseweb.com/wp-content/uploads/2026/06/Screenshot-2026-06-10-at-15.11.52-1024x514.png)
