As you might know, Oracle Cloud still has a fairly generous offer1 with up to 4 Ampere (ARM64) cores, 24 GB RAM, 200 GB storage, an IPv4 address and 10TB of traffic, entirely free of charge.
Unfortunately there is no pre-packaged Debian image available, IPv6 isn’t enabled by default and the OpenStack management console is fairly unintuitive, so here’s a write-up on how to do it.
Step 1 – register a free account on Oracle Cloud
Visit cloud.oracle.com and register an account. It requires a credit card in your name for security purposes.
Step 2 – get the Debian image
Download an ARM64 generic cloud qcow2 Debian image from https://cloud.debian.org/images/cloud/ to your PC
For example, this one: debian-12-genericcloud-amd64-20240102-1614.qcow2
Step 3 – import the image into OCI
Go to Storage – Buckets, click Create Bucket
(select your Compartment on the left if visiting for the first time)
Click Create Bucket
Go to Storage – Buckets – your bucket, click Upload, upload your Debian image (debian-*.qcow2)
Click Upload
Go to Instances – Custom Images, click Import Image
Name: enter image file name as the image name (e.g. debian-12-genericcloud-amd64-20240102-1614)
Bucket: select your bucket
Object name: select your image
Image type: select QCOW2
Click Import Image
(this takes a while to complete)
Go to Instances – Custom Images – your image, click Edit details
Unselect everything, select VM.Standard.A1.Flex
Click Save Changes
Go to Instances – Custom Images – your image, click Edit image capabilities
Firmware: Unselect BIOS
In-transit encryption: Disabled
Click Save Changes
Step 4 – create an IPv6-enabled network
Go to Networking – Virtual Cloud Networks, click Create VCN
Name: vcn1
IPv4 CIDR Blocks: type: 10.0.0.0/24, press Enter
IPv6 Prefixes: select Assign an Oracle allocated IPv6 /56 prefix
Click Create
Go to Networking – Virtual Cloud Networks – vcn1 – Subnets – click Create Subnet
Name: subnet1
IPv4 CIDR Block: 10.0.0.0/24
IPv6 Prefixes: select Assign an Oracle allocated IPv6 /64 prefix
Oracle allocated IPv6 address: enter 00
Route Table: Default Route Table
Select Public Subnet
Dhcp Options: Default DHCP Options
Security List: Default Security List
Click Create
Go to Networking – Virtual Cloud Networks – vcn1 – Internet Gateways – click Create Internet Gateway
Name: gw1
Click Create
Go to Networking – Virtual Cloud Networks – vcn1 – Route Table – Default Route Table,
Click Add Route Rules
Select IPv4
Target Type: Internet Gateway
Destination CIDR Block: 0.0.0.0/0
Target Internet Gateway: gw1
Click Add
Again click Add Route Rules
Select IPv6
Target Type: Internet Gateway
Destination CIDR Block: ::/0
Target Internet Gateway: gw1
Click Add
Go to Networking – Virtual Cloud Networks – vcn1 – Security Lists – Default Security List
Click Ingress Rules
Ensure ingress rules for port 22 exist for both 0.0.0.0/0 and ::/0
Click Egress Rules
Ensure egress rules exist for both 0.0.0.0/0 and ::/0. If ::/0 is missing, add it.
Note: if you ever need to delete an unused VCN, first delete all Route Tables, then it will be possible to delete the VCN.
Step 5 – create the instance
Go to Compute – Instances – click Create Instance
Image and shape – click Edit
Click Change image,
Select Image source: Custom images, select your debian image
Click Change shape,
Select Ampere – VM.Standard.A1.Flex
Select 4 CPU, 24 GB RAM (max free)
Networking – click Edit
Select existing virtual cloud network – vcn1
Select existing subnet – subnet1
Add SSH keys – select Paste public keys – paste your favorite public key(s)
Boot volume – click Specify a custom boot volume size
Enter: 200 (but note, 200 is the max free, so reduce it if you plan on running other instances, and keep in mind that minimum is 50)
Click Show advanced options – Oracle Cloud Agent – Unselect everything except Compute Instance Monitoring
Click Create
If you get an “Out of capacity” error, try selecting a different availability domain under “Placement”. Some zones have multiple domains, so it’s worth checking this. If still no luck, try a different zone (re-registering an account might be required) or just wait.
If successful, congratulations, but you’re not done yet!
Go to Compute – Instances – select your instance,
Go to Attached VNICs – click on Primary VNIC,
Click on IPv6 Addresses, Assign IPv6 Address
Select Prefix, click Assign
Step 6 – configure Debian
Now you should be able to reach your server via IPv4
ssh debian@<instance-ip>
Enable IPv6:
sudo su
“
echo "iface enp0s3 inet6 dhcp
>/etc/network/interfaces.d/60-inet6
Install OCI agent:
apt updateapt install snapd
snap install --classic oracle-cloud-agent
reboot
Et voilà. Enjoy!
1 In case the “always free” offer changes in the future, here’s a link to an archived copy, as was seen at the time of writing.