> ## Documentation Index
> Fetch the complete documentation index at: https://strettch-make-section-id-optional.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Managing Compute Instances

> Provision, resize, reboot, and connect to Strettch Cloud compute instances using the dashboard, with SSH key setup and lifecycle management tips.

## Creating Your First Compute Instance

**Problem**: How do I provision a new server with the right specifications for my application?

**Why it matters**: Choosing the correct configuration upfront prevents performance issues and unnecessary costs later.

Navigate to the **Computes** tab and click **New Compute** to begin. You'll configure your instance through six steps:

<Steps>
  <Step title="Choose Location">
    Select a hosting location for your server.

    The location you choose affects network latency and performance for your users. Select a location closest to where your primary traffic originates.
  </Step>

  <Step title="Choose Image">
    Select an operating system image for your compute.

    <Frame>
      <img src="https://mintcdn.com/strettch-make-section-id-optional/N8Ca_cgncHZgBCa2/images/computes/choose-image.png?fit=max&auto=format&n=N8Ca_cgncHZgBCa2&q=85&s=c6b8a585d0fedd38eed33c2eafa30d94" style={{ borderRadius: "0.2rem" }} width="2024" height="542" data-path="images/computes/choose-image.png" />
    </Frame>

    Available images include popular Linux distributions. Choose based on your application requirements and team familiarity.
  </Step>

  <Step title="Choose Type and Specifications">
    Select your compute configuration: `shared` or `dedicated` CPU.

    <Frame>
      <img src="https://mintcdn.com/strettch-make-section-id-optional/N8Ca_cgncHZgBCa2/images/computes/choose-type.png?fit=max&auto=format&n=N8Ca_cgncHZgBCa2&q=85&s=2da1e946d5a28cbe11405ec661ff5f67" style={{ borderRadius: "0.2rem" }} width="2024" height="1221" data-path="images/computes/choose-type.png" />
    </Frame>

    **Shared CPU**: Cost-effective for applications with variable load patterns

    **Dedicated CPU**: Consistent performance for production workloads

    After choosing the type, specify your compute specs: **CPU**, **RAM**, **Storage**. Pricing is displayed alongside each configuration so you can see costs in real-time.
  </Step>

  <Step title="Configure Authentication">
    Choose how you will securely access your compute instance:

    * **SSH Keys (Recommended)**: Select an existing SSH key attached to your team for automatic, passwordless access. See our [SSH Keys guide](/services/compute/ssh-keys) for setup instructions.
    * **Password**: Create a secure password for root user access.

    <Warning>
      **If using a Password:** Store your password securely using a password manager. You will not receive an email with your compute details or password. If you lose it, you'll need to reset it through console access.
    </Warning>
  </Step>

  <Step title="Configure Name and Tags">
    **Compute Name**: Give your compute an identifiable name that describes its purpose (e.g., "api-production", "staging-web-server")

    **Add Tags (Optional)**: Organize and manage your computes with custom tags. Useful for filtering, cost allocation, or automation.
  </Step>

  <Step title="Review and Create">
    Review your configuration and pricing, then click **Create Compute**.

    <Frame>
      <img src="https://mintcdn.com/strettch-make-section-id-optional/N8Ca_cgncHZgBCa2/images/computes/create-compute.png?fit=max&auto=format&n=N8Ca_cgncHZgBCa2&q=85&s=1eb39d43dca145e65c5751bcc2315ef5" style={{ borderRadius: "0.2rem" }} width="5088" height="3348" data-path="images/computes/create-compute.png" />
    </Frame>

    <Note>
      Your compute cost depends on the specs you selected. The price is shown during configuration. Ensure you have sufficient credits in your account to create the compute.
    </Note>

    Your compute will be provisioned within seconds. Once in the **Running** state, you can connect and start using it.
  </Step>
</Steps>

***

## Connecting to Your Compute Instance

**Problem**: How do I access my compute instance to install applications and manage services?

### Using the Web Console

Access your compute through a browser-based console without needing any SSH client software.

<Steps>
  <Step title="Navigate to Console">
    Click your compute name from the dashboard, then click **Console** in the left menu.

    <Frame>
      <img src="https://mintcdn.com/strettch-make-section-id-optional/N8Ca_cgncHZgBCa2/images/computes/open-console.png?fit=max&auto=format&n=N8Ca_cgncHZgBCa2&q=85&s=6c8aecb6b41b9a20f633baa9285cb951" style={{ borderRadius: '0.2rem' }} width="1338" height="300" data-path="images/computes/open-console.png" />
    </Frame>
  </Step>

  <Step title="Wait for SC Agent Installation">
    The [SC Agent](/agents/sc-agent) is automatically installed on your compute. It will be ready within a few minutes of compute creation.

    The SC Agent enables browser-based console access. You can start using the console as soon as the agent installation completes.
  </Step>

  <Step title="Access Your Terminal">
    Once the console loads, you'll have a full terminal interface to your compute. Enter your root password to log in.
  </Step>
</Steps>

### Using SSH Access

Connect directly via SSH from your local terminal for a native command-line experience.

<Steps>
  <Step title="Find Your Compute IP Address">
    Locate your compute's public IP address on the compute details page in the dashboard.
  </Step>

  <Step title="Connect via SSH">
    Open your terminal and connect using this command:

    ```bash SSH connection theme={null}
    ssh root@your-public-ip -p 222
    ```

    Replace `your-public-ip` with your actual compute IP address.

    **Example:**

    ```bash Example theme={null}
    ssh root@192.0.2.1 -p 222
    ```

    <Note>
      **Port 222:** Strettch Cloud uses port 222 instead of the default port 22 for SSH access due to a firewall restriction from our upstream internet provider. This applies to most connections. However, if you are connecting from within certain networks (such as MTN in Rwanda), you may be able to connect using the default port 22 without specifying `-p 222`.
    </Note>
  </Step>

  <Step title="Enter Your Password">
    When prompted, enter the root password you created during compute setup.

    <Warning>
      If you've forgotten your root password, reset it using console access through the web dashboard.
    </Warning>
  </Step>
</Steps>

***

## Understanding Networking

**Problem**: How do I make my compute instance accessible from the internet, and when should I use public vs private networking?

**Why it matters**: Proper network architecture significantly improves security by limiting attack surface and helps reduce costs by only paying for public IPs where needed.

### Public IP Addresses (Optional)

By default, compute instances are **not** assigned a public IP address. They remain in a private network, inaccessible from the internet but able to communicate with other instances in your team.

#### When You Need a Public IP

You need a public IP address when your instance must:

* **Receive incoming connections** from the internet (web servers, APIs, public-facing services)
* **Be accessed via SSH** directly from your local machine
* **Serve as an entry point** to your infrastructure (reverse proxies, load balancers)

#### Cost

<Warning>
  Public IP addresses are billed separately from compute resources. The pricing for public IPs can be found in your dashboard when creating a compute instance. Check the current rates before enabling this option.
</Warning>

#### How to Attach a Public IP

When creating a compute instance, you'll see an option to attach a public IP:

<Frame>
  <img src="https://mintcdn.com/strettch-make-section-id-optional/N8Ca_cgncHZgBCa2/images/computes/attach-public-ip.png?fit=max&auto=format&n=N8Ca_cgncHZgBCa2&q=85&s=425d8526f70b7a7520faf77d96d16700" style={{ borderRadius: "0.2rem" }} width="1898" height="418" data-path="images/computes/attach-public-ip.png" />
</Frame>

Simply check the box to attach a public IP to your instance.

### Private Network Architecture (Recommended for Security)

**Problem**: How can I improve security while running multiple services?

**Best practice**: Use a single public-facing instance as a gateway, keeping your application servers private.

#### Example Architecture

Imagine you're running a web application with these components:

<Frame>
  <img className="block dark:hidden" src="https://mintcdn.com/strettch-make-section-id-optional/N8Ca_cgncHZgBCa2/images/computes/public-private-internet-archtecture.jpg?fit=max&auto=format&n=N8Ca_cgncHZgBCa2&q=85&s=ef0db7bdc1164c301785bc3644885502" style={{ borderRadius: '0.2rem' }} width="2326" height="2032" data-path="images/computes/public-private-internet-archtecture.jpg" />

  <img className="hidden dark:block" src="https://mintcdn.com/strettch-make-section-id-optional/N8Ca_cgncHZgBCa2/images/computes/public-private-internet-archtecture-dark.jpg?fit=max&auto=format&n=N8Ca_cgncHZgBCa2&q=85&s=4ad9a1417578bf9c8f4329676e8ea3c8" style={{ borderRadius: '0.2rem' }} width="2326" height="2032" data-path="images/computes/public-private-internet-archtecture-dark.jpg" />
</Frame>

**How this architecture works:**

**Private Network (Foundation)**

* All computes exist in a secure private network where they can communicate with each other

**Public IP Assignment (Optional)**

* **Reverse Proxy**: Has a public IP attached, making it accessible from the internet and able to route traffic to private services
* **Frontend, Backend, Database**: No public IPs attached, so they remain inaccessible from the internet but can communicate within the private network

**Benefits of this approach:**

1. **Enhanced Security** - Only one compute is exposed to the internet, reducing attack surface
2. **Cost Savings** - Pay for only one public IP instead of multiple (public IPs are billed separately)
3. **Centralized Public Security** - Configure internet-facing firewalls, SSL certificates, and security rules in one place
4. **Simplified Management** - Update public security measures on one compute instead of multiple

***

## Monitoring Performance and Health

**Problem**: How do I know if my compute instance is performing well or experiencing issues?

**Why it matters**: Proactive monitoring helps you identify performance bottlenecks, plan capacity upgrades, and troubleshoot issues before they impact users.

Click on your compute name in the **Computes** tab to access detailed monitoring and management.

<Frame>
  <img src="https://mintcdn.com/strettch-make-section-id-optional/N8Ca_cgncHZgBCa2/images/computes/compute-overview.png?fit=max&auto=format&n=N8Ca_cgncHZgBCa2&q=85&s=e3d6d7669cdd1f0a85c6495d9476cc15" style={{ borderRadius: '0.2rem' }} width="5088" height="3348" data-path="images/computes/compute-overview.png" />
</Frame>

### Available Metrics

Your compute includes five real-time performance graphs that help you understand resource utilization:

| Metric        | What It Shows                                                 | What to Watch For                                          |
| ------------- | ------------------------------------------------------------- | ---------------------------------------------------------- |
| **Memory**    | Memory usage over time                                        | Consistently high usage (>90%) indicates you need more RAM |
| **CPU Usage** | Processing power utilization (user jobs and system processes) | Sustained high CPU (>80%) suggests you need more CPU cores |
| **Disk I/O**  | Read and write operations in MB/s                             | High I/O wait times can slow down applications             |
| **Network**   | Inbound and outbound traffic (packets)                        | Unexpected spikes may indicate traffic anomalies           |
| **Load**      | System load average (number of processes waiting for CPU)     | Load higher than CPU count suggests resource contention    |

### Time Range Options

View graphs for different time periods to understand short-term issues or long-term trends:

* **1 hour** - Real-time troubleshooting
* **6 hours** - Recent performance patterns
* **24 hours** - Daily usage cycles
* **7 days** - Weekly trends
* **30 days** - Monthly patterns and capacity planning

Hover over any graph to see exact metrics at specific points in time.

### SC Metrics Agent

The [SC Metrics Agent](/agents/sc-metrics-agent) automatically installs with your compute to collect performance data. This agent runs in the background and sends metrics to the dashboard for visualization.

<Warning>
  If you uninstall the SC Metrics Agent, monitoring data collection will stop and graphs will be unavailable. Only remove this agent if you're using alternative monitoring solutions.
</Warning>

***

## Managing Compute Power States

**Problem**: How do I control when my compute instance is running or stopped?

### Turning Your Compute ON or OFF

<Steps>
  <Step title="Navigate to Compute Details">
    Click your compute name from the dashboard.
  </Step>

  <Step title="Use the Power Switch">
    Click the switch button next to the Console button.

    <Frame>
      <img src="https://mintcdn.com/strettch-make-section-id-optional/N8Ca_cgncHZgBCa2/images/computes/turn-on-off.png?fit=max&auto=format&n=N8Ca_cgncHZgBCa2&q=85&s=cf22b05d63a912c24383f7ff74e16f85" style={{ borderRadius: '0.2rem' }} width="5088" height="3348" data-path="images/computes/turn-on-off.png" />
    </Frame>

    The system will attempt a graceful shutdown first. If that fails, it will force shutdown.
  </Step>
</Steps>

### Graceful Shutdown from Command Line

For maximum data integrity, shut down from within your compute instance:

```bash Graceful shutdown theme={null}
poweroff
```

This ensures all running processes close properly and data is written to disk before shutdown.

<Warning>
  **Billing continues for powered-off computes.** Stopped instances still reserve resources (CPU, RAM, storage) and incur charges at the same rate. To stop billing completely, you must destroy the compute instance.
</Warning>

***

## Best Practices

**Problem**: How do I ensure my compute instances are secure, performant, and cost-effective?

**Why it matters**: Following best practices prevents security breaches, performance issues, and unexpected costs.

### Security

**Use SSH Keys Instead of Passwords**

* SSH keys provide far stronger security against brute-force attacks than traditional passwords.
* Strettch Cloud allows you to natively inject your SSH keys into your instances during creation.
* Check out our [SSH Keys documentation](/services/compute/ssh-keys) to learn how to add your public keys to your team dashboard for easy, secure deployments without ever manually editing an `authorized_keys` file.

**Keep Your System Updated**

* Regularly update your operating system and packages
* Run `apt update && apt upgrade` (Ubuntu/Debian) or equivalent for your OS
* Subscribe to security mailing lists for your distribution

**Configure a Firewall**

* Use `ufw` (Uncomplicated Firewall) or `iptables` to restrict access
* Only open ports that your applications actually need
* Consider using port 222 for SSH (as configured) to avoid automated scanners

**Limit Root Access**

* Create a non-root user for daily operations
* Use `sudo` for administrative tasks
* Only use root when absolutely necessary

### Performance

**Monitor Resource Usage**

* Check your monitoring graphs regularly
* Set up alerts for sustained high CPU or memory usage
* Plan upgrades before hitting resource limits

**Choose the Right Instance Type**

* Use shared CPU for development and staging
* Use dedicated CPU for production workloads
* Start small and scale up based on actual usage

**Optimize Application Performance**

* Profile your applications to find bottlenecks
* Use caching where appropriate (Redis, Memcached)
* Optimize database queries and indexes

### Cost Management

**Right-Size Your Instances**

* Don't over-provision resources "just in case"
* Review metrics after a few weeks and adjust specifications
* Scale up only when metrics consistently show resource constraints

**Destroy Unused Instances**

* Delete development or testing instances when not in use
* Remember: stopped instances still incur charges
* Use tags to identify instances that can be safely destroyed

**Plan for Growth**

* Monitor usage trends over 30 days
* Anticipate capacity needs before hitting limits
* Consider reserved instances for long-running workloads (if available)

***

## Need Help?

Contact our [support team](mailto:cloud@strettch.com) or visit [our site](https://cloud.strettch.com).
