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

# Ubuntu VPS

> Ubuntu 24.04 LTS on your own VPS with root SSH access, a browser console, snapshots and resizing

## Ubuntu VPS on RepoCloud

Ubuntu VPS gives you a plain Ubuntu 24.04 LTS virtual private server with root access. Install what you need with `apt` and build whatever you want: web servers, databases, development environments, CI runners, monitoring stacks, VPN endpoints, or anything else that runs on Linux.

This is the blank server that every VPS App starts as. Nothing is installed on it and it has no AI chat. To have an application installed for you, use [AI Deploy](https://repocloud.io/docs/deployment/ai-deploy.md): it creates the same kind of Ubuntu server and the [DevOps AI Agent](https://repocloud.io/docs/ai-agents/devops-ai-agent.md) installs the application in a chat.

> **Plain Ubuntu**
>
> A plain Ubuntu 24.04 LTS server with root access where you install what you need with `apt`

> **Full Root Access**
>
> Root SSH access from the first minute: the deployment email holds the root password and, when one was generated, the private key of a generated Ed25519 key pair

> **Long-Term Support**
>
> Ubuntu 24.04 LTS is supported by Canonical until May 2029, and until May 2034 with Ubuntu Pro

> **Flexible Pricing**
>
> Start from about $6.00 a month (Tier 2: 1 vCPU, 2 GB RAM, 30 GB SSD, $0.0083 per hour). Resize from the manage page. Dedicated IPv4 included with every server.

> **Snapshots**
>
> Create point-in-time snapshots before risky changes (up to 5, $0.10 per GB per month) and roll back from the Snapshots card after you confirm

> **Browser Console**
>
> A console in the browser that works without SSH, useful for boot issues or firewall lockouts

## Deploying Ubuntu on RepoCloud

**1. Find Ubuntu in the Marketplace**

Go to the [RepoCloud marketplace](https://repocloud.io/results/) and search for "Ubuntu". Click on the Ubuntu VPS listing.

**2. Enter a Project Name**

Choose a friendly name for your project (e.g., "my-server").

**3. Choose Resource Settings**

Select a tier for your server. The list starts at Tier 2 (1 vCPU, 2 GB RAM, 30 GB SSD, $0.0083 per hour, about $6.00 per 720-hour month) and ends at Tier 7; the 1 GB tier is not offered for Ubuntu VPS. A dedicated IPv4 address is included with every VPS at no extra charge. A server can later move to a tier whose disk is not smaller than its current one: RAM and CPU can go down, but the disk does not shrink.

**4. Deploy**

Click **Deploy Ubuntu VPS** and wait about 1–2 minutes.

**5. Check Your Email**

Once deployment finishes, you receive an email with:
- **SSH command** — `ssh root@<your-ipv4-address>`
- **Root Password** and **IPv4 Address** of the server
- **SSH Private Key** — present when one was generated; save it to a file, `chmod 600`, and use it to connect. If it does not log you in, use the root password from the same email.
- **Manage Instance** button — link to the RepoCloud manage page

> [!NOTE]
>
> Ubuntu VPS has no web application, so there is no address to open on the dashboard. A web server you install is reached on the IPv4 address or the default domain name of the server; the default domain resolves straight to the server and has HTTPS only if you set it up. Reach the server through SSH or the browser console.

## Connecting via SSH

### Save Your Private Key

Your deployment email includes an Ed25519 private key when one was generated. Save it to a file on your local machine:

```bash
# Create the folder if needed, then paste the key contents into a file
mkdir -p ~/.ssh
nano ~/.ssh/repocloud_ubuntu

# OpenSSH ignores a private key that other users can read, with a warning,
# and asks for the password instead
chmod 600 ~/.ssh/repocloud_ubuntu
```

If the key does not log you in, the root password from the same email does.

### Connect

```bash
ssh -i ~/.ssh/repocloud_ubuntu root@<your-ipv4-address>
```

Your IPv4 address is shown in the RepoCloud manage page under **Access**, and in the deployment email.

### Add More SSH Keys

To let another key log in, add it to `~/.ssh/authorized_keys` on the server. The **SSH Keys** card on the manage page only keeps the list of your account's public keys; it installs nothing on a server that is already running.

```bash
# On the server (run mkdir -p ~/.ssh first if the folder does not exist)
cat >> ~/.ssh/authorized_keys << 'EOF'
ssh-ed25519 AAAA... your-other-key
EOF
chmod 600 ~/.ssh/authorized_keys
```

Each key needs its own line: if the last line of the file has no line break, the new key joins it. `authorized_keys` must not be writable by other users.

## Initial Server Setup

After connecting via SSH, here is a recommended baseline setup:

### Update Packages

```bash
apt update && apt upgrade -y
```

### Configure the Firewall

UFW is Ubuntu's firewall front end; it does nothing until you enable it. Check it with `ufw status`. If `ufw` is not found, install it with `apt install -y ufw`:

```bash
ufw status
ufw allow 22/tcp     # SSH
ufw allow 80/tcp     # HTTP (if hosting a website)
ufw allow 443/tcp    # HTTPS (if hosting a website)
ufw enable
```

Keep this order. Once the firewall is enabled, incoming connections are dropped unless a rule allows them, so enabling it without the rule for port 22 cuts your SSH session. The browser console on the manage page is meant for firewall lockouts.

### Create a Non-Root User (Optional)

```bash
adduser deploy
apt install -y sudo        # only if sudo is not installed
usermod -aG sudo deploy

# Copy SSH authorized keys
mkdir -p /home/deploy/.ssh
cp ~/.ssh/authorized_keys /home/deploy/.ssh/
chown -R deploy:deploy /home/deploy/.ssh
chmod 700 /home/deploy/.ssh
chmod 600 /home/deploy/.ssh/authorized_keys
```

The `sudo` group does nothing without the `sudo` program, which is why the install comes first.

### Set the Timezone

```bash
timedatectl set-timezone UTC    # or your preferred timezone
```

`timedatectl list-timezones` lists the names.

### Enable Automatic Security Updates

```bash
apt install -y unattended-upgrades
dpkg-reconfigure -plow unattended-upgrades
```

Installing the package already switches daily updates on, so `dpkg-reconfigure` is for changing the choice.

## Common Use Cases

### Web Server (Nginx)

```bash
apt install -y nginx
systemctl enable nginx
ufw allow 'Nginx Full'    # if ufw is not found: apt install -y ufw first
```

Place your site in `/var/www/html/`, or write a virtual host in `/etc/nginx/sites-available/` and link it into `/etc/nginx/sites-enabled/`; it takes effect only after that.

To serve a site on your own name, create an A record at your DNS provider that points to the server's IPv4 address and set the name up in nginx and Certbot. That is your DNS and your server software, not a RepoCloud setting.

For HTTPS, install Certbot:

```bash
apt install -y certbot python3-certbot-nginx
certbot --nginx -d yourdomain.com
```

Issuing a certificate needs a domain that resolves to the server.

### Database Server (PostgreSQL)

```bash
apt install -y postgresql postgresql-contrib
systemctl enable postgresql

# Create a database and user (as root, runuser needs no sudo)
runuser -u postgres -- createuser --interactive appuser
runuser -u postgres -- createdb mydb
```

### Development Environment

```bash
# curl, if it is not installed
apt install -y curl

# Node.js (via NodeSource)
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt install -y nodejs

# Python
apt install -y python3 python3-pip python3-venv

# Docker
curl -fsSL https://get.docker.com | bash
```

Docker's own documentation cautions that its convenience script is not recommended for production environments, and that a published container port is reachable even when ufw has no rule for it.

### VPN Endpoint (WireGuard)

```bash
apt install -y wireguard
umask 077
wg genkey | tee /etc/wireguard/privatekey | wg pubkey > /etc/wireguard/publickey
```

The `umask 077` line keeps the private key unreadable by other users. Configure `/etc/wireguard/wg0.conf` with your network settings, then:

```bash
systemctl enable wg-quick@wg0
systemctl start wg-quick@wg0
```

### CI Runner (GitHub Actions)

Copy the current commands from the **New self-hosted runner** page of your GitHub repository: it carries the current version and download address. The example below shows their shape. Run the runner as the non-root user from the section above, because as root `./config.sh` refuses to run.

```bash
# As the non-root user (su - deploy): download the runner
mkdir actions-runner && cd actions-runner
curl -o actions-runner-linux-x64.tar.gz -L \
  https://github.com/actions/runner/releases/download/v2.321.0/actions-runner-linux-x64-2.321.0.tar.gz
tar xzf actions-runner-linux-x64.tar.gz

# Configure (use the token from your GitHub repository settings)
./config.sh --url https://github.com/your-org/your-repo --token YOUR_TOKEN
sudo ./svc.sh install
sudo ./svc.sh start
```

## RepoCloud Manage Page

Your Ubuntu VPS has its own manage page in the RepoCloud dashboard:

> **Access**
>
> View your server's IPv4 address, its default domain (plain text: a free name whose DNS already points at the server's IPv4 address), and the SSH connection command. The root password is never shown in the browser: **Email Me** sends it and **Reset** sets a new one and emails it. Ubuntu does not show a clickable URL because there is no web application.

> **Power**
>
> **Power Off** stops the server and keeps its disk and IP address. **Power On** starts it again and needs a balance above zero. **Reboot** restarts it without data loss. The buttons shown depend on the server's state. A powered-off server is billed at the full hourly rate.

> **Console**
>
> A browser-based serial console that works when SSH is unreachable, useful for boot issues or firewall lockouts. You log in as root with the root password. The button is disabled while the server is paused for a low balance.

> **SSH Keys**
>
> The card keeps the list of your account's public keys (up to 20); it adds nothing to a running server and removes nothing from it. To let a team member in, or to revoke a key, edit `~/.ssh/authorized_keys` on the server. Deleting a key's line stops new logins with that key, not a session that is already open.

> **Resize**
>
> Switch between tiers. The list does not show Tier 1 for Ubuntu VPS. A tier whose disk is smaller than the current one is disabled ("Downgrades are not possible because the disk cannot be shrunk"), and a sold-out tier is disabled too. To downsize the disk, create a new instance.

> **Snapshots**
>
> Create up to 5 point-in-time snapshots at $0.10 per GB per month. Best practice: snapshot before upgrading the kernel, changing firewall rules, or any other potentially destructive operation. To restore, click **Restore** next to the target snapshot. If newer snapshots exist, the confirmation dialog lists exactly which ones will be permanently deleted by the rollback. The server restarts during restore (the dialog estimates 10–25 seconds) and the page refreshes by itself when it is done.

> **Usage**
>
> Charts of the server's CPU, RAM, disk, and outbound bandwidth over 24 hours, 7 days, or 30 days.

> **Danger Zone**
>
> Permanently delete the server, all data, snapshots, and any IPv4 reservation.

## Snapshots and Backup Strategy

Snapshots capture the entire disk state at a point in time. Use them as safety nets:

1. **Before upgrades**: `apt upgrade`, kernel updates, or major configuration changes
2. **Before experiments**: testing new software stacks, network configurations, or security policies
3. **Regular intervals**: create a weekly snapshot and delete old ones (5 max); snapshots are billed by size and month, which is a reason to delete the ones you no longer need

### Restoring a Snapshot

Click **Restore** next to the snapshot you want to roll back to. If newer snapshots exist between the target and the current state, a warning lists them — those snapshots will be **permanently deleted** because the rollback cannot preserve them. The target snapshot itself always survives. Everything written after the snapshot is lost, because the disk is rolled back. The server restarts during the restore operation (about 10 to 25 seconds, as the dialog says) and the page refreshes by itself when it is done.

For off-server backups, consider:

- `rsync` to another server or local machine
- `restic` to S3-compatible storage, or `borgbackup` to another server over SSH
- Database-specific dump tools: `pg_dump` is installed with PostgreSQL, and `mysqldump` needs `apt install mysql-client`

## Resizing

You can change tiers from the manage page. Resizing to a tier with a larger disk permanently increases the disk allocation. Tiers with a smaller disk are disabled, whereas a tier with the same disk and less RAM or fewer vCPUs can be chosen.

### When to Resize

- **CPU-bound workloads** (compilation, encoding): move to a tier with more vCPUs
- **Memory-bound workloads** (databases, caches): move to a tier with more RAM
- **Storage-bound workloads**: pick a tier with a larger disk (30, 40, 40, 80, 160, and 320 GB from Tier 2 to Tier 7); a larger disk cannot be undone

## Troubleshooting

> **Cannot SSH after deployment**
>
> Verify you saved the private key with `chmod 600`. Ensure you are using the correct IP from the manage page. If the key does not log you in, use the root password from the deployment email; the key in the email may belong to another server. If all else fails, use the browser console from the manage page.

> **Locked out by UFW**
>
> If you accidentally blocked SSH with a firewall rule, use the browser console from the RepoCloud manage page: it is a login prompt that works even when SSH is unreachable. Run `ufw allow 22/tcp` and `ufw reload` to restore SSH access.

> **Server unreachable after kernel update**
>
> If the server does not boot after a kernel update, restore the snapshot you took before it; a restore rolls the disk back. Take a snapshot before every kernel update.

> **Disk full**
>
> Check usage with `df -h`. Clean package caches: `apt clean`. `apt autoremove` removes packages that were installed as dependencies and are no longer needed. Check `/var/log` for large log files. If you need more space, resize to a tier with a larger disk from the manage page (Tier 3 and Tier 4 share a 40 GB disk).

## Use Cases

Ubuntu VPS is ideal for:

- **Developers** who need a plain Linux environment for coding, testing, or running dev tools
- **System administrators** setting up custom infrastructure (web servers, databases, monitoring)
- **DevOps engineers** running CI runners, build servers, or deployment pipelines
- **Network engineers** deploying VPN endpoints, DNS servers, or reverse proxies
- **Students and learners** practicing Linux administration in a real cloud environment
- **Anyone** who needs their own Linux server without the opinions of a pre-installed application

## Next Steps

> **[Deploy Ubuntu VPS](https://repocloud.io/details/Ubuntu%20VPS/)**
>
> Launch your Ubuntu VPS from the RepoCloud marketplace

> **[Ubuntu Server Guide](https://ubuntu.com/server/docs)**
>
> Read the official Ubuntu Server documentation from Canonical

> **[AI Deploy](https://repocloud.io/docs/deployment/ai-deploy.md)**
>
> Have the DevOps AI Agent install an application on an Ubuntu server for you

> **[VPS Apps Overview](https://repocloud.io/docs/deployment/vps-apps.md)**
>
> Learn about VPS Apps and the RepoCloud manage page
