> For the complete documentation index, see [llms.txt](https://kermitcloud.gitbook.io/kermitcloud-hosting-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kermitcloud.gitbook.io/kermitcloud-hosting-wiki/vps-servers/how-to-install-sudo.md).

# How To Install Sudo

Installing **sudo** on a Virtual Private Server (VPS) is straightforward! Here's how to do it based on your server's operating system:

#### **For Ubuntu/Debian-based VPS Servers**:

1. **Update the package list**:

   bash

   ```
   sudo apt update
   ```

   If `sudo` is not installed yet, you'll need to use a root account or switch to root:

   bash

   ```
   su
   apt update
   ```
2. **Install sudo**:

   bash

   ```
   apt install sudo
   ```
3. **Verify sudo installation**:

   bash

   ```
   sudo --version
   ```
4. **Add a user to the sudo group**:

   bash

   ```
   usermod -aG sudo username
   ```

   Replace `username` with your actual username.

#### **For CentOS/RHEL-based VPS Servers**:

1. **Switch to root user**:

   bash

   ```
   su
   ```
2. **Install sudo**:

   bash

   ```
   yum install sudo
   ```
3. **Confirm installation**:

   bash

   ```
   sudo --version
   ```
4. **Grant sudo privileges to a user**:
   * Open the sudoers file for editing:

     bash

     ```
     visudo
     ```
   * Add the following line:

     ```
     username ALL=(ALL) ALL
     ```

     Replace `username` with the actual user's name.

#### **For Alpine Linux-based VPS Servers**:

1. **Log in as root**:

   bash

   ```
   su
   ```
2. **Install sudo**:

   bash

   ```
   apk add sudo
   ```
3. **Configure sudo privileges**:
   * Add the user to the `wheel` group:

     bash

     ```
     adduser username wheel
     ```
   * Edit the `/etc/sudoers` file using:

     bash

     ```
     visudo
     ```
