005. Oracle Cloud Always Free Instance Ubuntu -> Debian Conversion

Motivation

During 2016, Oracle started a public services of cloud IaaS, PaaS, etc., Component of their adoption strategy includes an assortment of "Always Free" resources available to service account owners. Leaving aside the Philosophical, ownership and open source concerns from the community, these Always Free resources still provide a great testing and learning ground for #homelab and #selfhosting.

When creating an always free compute instance in Oracle Cloud, the standard Operative Systems include Oracle Linux, Redhat, Almalinux, Ubuntu, among others. These options are plenty and fit most use cases, however, due to personal preferences, you may want to use Debian instead.

Core Objective

Modify an existing Oracle Cloud Compute Instance (Virtual Machine) to run Debian 11 or Debian 12 as Operative System.

Required Tools

  1. Oracle Account - Get your Free trial here
  2. Existing Oracle Compute Instance with Ubuntu 20.04-24.04 (Not Minimal)
  3. Existing Oracle Compute Instance with Internet Allow access in Oracle Network

Instructions

  1. Log in to your existing Instance through SSH, default Image user account is "ubuntu"
ssh ubuntu@<your public IPv4 address>
  1. Confirm Internet Access
curl ifconfig.co/country

Output of this command should be the Country of location of your Compute Instance

  1. Download the Debi Reinstallation script. This works for both Ampere and AMD/Intel Instances
curl -fLO https://raw.githubusercontent.com/bohanyang/debi/master/debi.sh

Reference:

GitHub - bohanyang/debi: Reinstall your VPS to minimal Debian
Reinstall your VPS to minimal Debian. Contribute to bohanyang/debi development by creating an account on GitHub.
  1. Execute the script
chmod a+rx debi.sh
sudo ./debi.sh --version XX

This script can install Debian 10, 11, 12. Feel free to use your preferred ones.

Note: If your SSH Access Pub Key is already publish to Github, you can prepare your Debian Installation with it as installation process.

sudo ./debi.sh --version XX --authorized-keys-url https://github.com/USERNAME.keys
  1. the default account that will be created will be "debian" you will be asked by a password.
  2. The script will download all the boot partition and initiate a net install of Debian, this process may take 5-10 minutes
  3. Once completed, Login through SSH to your modified Compute Instance, using the "debian" account, with either password or SSH Keys configured.

Recommended Post Install Steps:

  1. Create a different administrative account
  2. Confirm that the allocated Space and Memory remains as configured layout with df -h, free -h, etc.
  3. Configure proper Sudo permissions
  4. deluser "debian" account
  5. Implement your preferred hardening settings.
  6. Update OS installation and features, apt-get update/upgrade

Results

By following these steps, your existing Ubuntu Oracle Compute Instance will run Debian on your preferred version, instead of Ubuntu.

Show Comments
Creative Commons License
Content published under: Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.