> ## Documentation Index
> Fetch the complete documentation index at: https://help.onetsolutions.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Install K3s Kubernetes

> Install K3s lightweight Kubernetes on your VPS

K3s is a lightweight Kubernetes distribution designed for resource-constrained environments, making it ideal for running Kubernetes on a VPS.

<Info>
  **Prerequisites**

  * A VPS with OnetSolutions
  * SSH access to your server
  * Root or sudo privileges
</Info>

## Installation Steps

<Steps>
  <Step title="Connect to your VPS">
    Connect via SSH to your server.
  </Step>

  <Step title="Install K3s">
    Run the K3s installation script:

    ```bash theme={null}
    curl -sfL https://get.k3s.io | sh -
    ```
  </Step>

  <Step title="Wait for installation">
    The installation may take a few minutes. K3s will automatically start after installation.
  </Step>

  <Step title="Configure kubectl">
    Copy the K3s configuration for kubectl:

    ```bash theme={null}
    mkdir -p ~/.kube
    sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
    sudo chown $USER:$USER ~/.kube/config
    ```
  </Step>

  <Step title="Verify installation">
    Check that K3s is running:

    ```bash theme={null}
    kubectl get nodes
    ```

    You should see your VPS listed as a node.
  </Step>
</Steps>

## Deploying Applications

<Steps>
  <Step title="Create a manifest file">
    Create a Kubernetes manifest file (e.g., `my-app.yaml`) describing your application.
  </Step>

  <Step title="Deploy the application">
    ```bash theme={null}
    kubectl apply -f my-app.yaml
    ```
  </Step>

  <Step title="Check deployment status">
    ```bash theme={null}
    kubectl get pods
    kubectl get services
    ```
  </Step>
</Steps>

## Managing K3s

<AccordionGroup>
  <Accordion title="Stop K3s">
    ```bash theme={null}
    sudo systemctl stop k3s
    ```
  </Accordion>

  <Accordion title="Start K3s">
    ```bash theme={null}
    sudo systemctl start k3s
    ```
  </Accordion>

  <Accordion title="Uninstall K3s">
    ```bash theme={null}
    /usr/local/bin/k3s-uninstall.sh
    ```
  </Accordion>
</AccordionGroup>

<Tip>
  For more information, refer to the [official K3s documentation](https://docs.k3s.io/).
</Tip>
