<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Oracle — Host Boards</title>
        <link>https://hostboards.com/index.php?p=/</link>
        <pubDate>Wed, 29 Jul 2026 12:38:57 +0000</pubDate>
        <language>en</language>
            <description>Oracle — Host Boards</description>
    <atom:link href="https://hostboards.com/index.php?p=/discussions/tagged/oracle/feed.rss" rel="self" type="application/rss+xml"/>
    <item>
        <title>How to Host a Website in Oracle Cloud Free Tier</title>
        <link>https://hostboards.com/index.php?p=/discussion/5183/how-to-host-a-website-in-oracle-cloud-free-tier</link>
        <pubDate>Tue, 08 Feb 2022 21:18:17 +0000</pubDate>
        <category>Tutorials</category>
        <dc:creator>MonstaHost</dc:creator>
        <guid isPermaLink="false">5183@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>Hosting a Website in Oracle Cloud Free Tier</p>

<ul>
<li>by author "<em>Your Sunny</em>" found here:<br />
<a href="https://yoursunny.com/" rel="nofollow">https://yoursunny.com/</a><br />
---------------------------------------‐-----------------<br />
Oracle Cloud is a cloud computing service offered by Oracle Corporation.<br />
Oracle Cloud has a generous free tier that offers two "always free" Micro instances with the following specification:</li>
</ul>

<p>KVM virtualization<br />
1/8 CPU cores (AMD EPYC 7551)<br />
1GB memory<br />
47GB disk storage<br />
1 IPv4 address<br />
up to 32 IPv6 addresses<br />
50Mbps Internet bandwidth<br />
I signed up for Oracle Cloud, so that I can have some more free computing resources to play with.</p>

<p>The sign-up procedure requires a credit card for identity confirmation purpose, but the credit card will not be charged.<br />
During sign-up, there's a choice of home region, which determines the location of VM instances; once selected, it cannot be changed in the future.</p>

<p>A common use case for a virtual machine is to host a website.<br />
Due to the firewalls, hosting a website on Oracle Cloud needs a few more steps.<br />
Here's exactly how to deploy a website in a Oracle Cloud Free Tier VM instance.</p>

<p>UPDATED 2022-01-27:<br />
Oracle Cloud now supports IPv6.<br />
Instructions are updated to enable IPv6 on the web server.</p>

<p>Create a VM Instance<br />
Each Oracle Cloud account is eligible for two Always Free Micro instances.<br />
To create a VM, sign in to the Oracle Cloud console, in "Launch Resources" section click Create a VM instance.<br />
This takes us to the "Create Compute Instance" page.</p>

<p>In "Image and shape" section, select VM.Standard.E2.1.Micro shape and Canonical Ubuntu 20.04 image.<br />
Do not use the "Canonical Ubuntu 20.04 Minimal" image.</p>

<p>Create Compute Instance - Image and shape</p>

<p>In "Configure network" section, select Create new virtual cloud network, and keep other options at their default values.</p>

<p>In "Add SSH keys" section, select Paste public keys, and paste your SSH public key in the text box below.<br />
If you do not have a SSH public key, follow this guide to generate one.</p>

<p>Finally, click the Create button to create the compute VM instance.<br />
Within a few seconds, you should see the "Instance Details" page.</p>

<p>Instance Details</p>

<p>You can SSH into the VM instance using the public IP address and username displayed in the "Instance Access" section.</p>

<p>LowEndSpirit<br />
HOME › TECHNICAL<br />
Search<br />
How to Host a Website in Oracle Cloud Free  Tier</p>

<p>Oracle Cloud is a cloud computing service offered by Oracle Corporation.<br />
Oracle Cloud has a generous free tier that offers two "always free" Micro instances with the following specification:</p>

<p>KVM virtualization<br />
1/8 CPU cores (AMD EPYC 7551)<br />
1GB memory<br />
47GB disk storage<br />
1 IPv4 address<br />
up to 32 IPv6 addresses<br />
50Mbps Internet bandwidth<br />
I signed up for Oracle Cloud, so that I can have some more free computing resources to play with.<br />
The sign-up procedure requires a credit card for identity confirmation purpose, but the credit card will not be charged.<br />
During sign-up, there's a choice of home region, which determines the location of VM instances; once selected, it cannot be changed in the future.</p>

<p>A common use case for a virtual machine is to host a website.<br />
Due to the firewalls, hosting a website on Oracle Cloud needs a few more steps.<br />
Here's exactly how to deploy a website in a Oracle Cloud Free Tier VM instance.</p>

<p>UPDATED 2022-01-27:<br />
Oracle Cloud now supports IPv6.<br />
Instructions are updated to enable IPv6 on the web server.</p>

<p>Create a VM Instance<br />
Each Oracle Cloud account is eligible for two Always Free Micro instances.<br />
To create a VM, sign in to the Oracle Cloud console, in "Launch Resources" section click Create a VM instance.<br />
This takes us to the "Create Compute Instance" page.</p>

<p>In "Image and shape" section, select VM.Standard.E2.1.Micro shape and Canonical Ubuntu 20.04 image.<br />
Do not use the "Canonical Ubuntu 20.04 Minimal" image.</p>

<p>Create Compute Instance - Image and shape</p>

<p>In "Configure network" section, select Create new virtual cloud network, and keep other options at their default values.</p>

<p>In "Add SSH keys" section, select Paste public keys, and paste your SSH public key in the text box below.<br />
If you do not have a SSH public key, follow this guide to generate one.</p>

<p>Finally, click the Create button to create the compute VM instance.<br />
Within a few seconds, you should see the "Instance Details" page.</p>

<p>Instance Details</p>

<p>You can SSH into the VM instance using the public IP address and username displayed in the "Instance Access" section.</p>

<p>Enable IPv6<br />
In this year, it is important for websites to support IPv6.<br />
Today, most cellular networks are IPv6 only.<br />
By enabling IPv6, it enables mobile users to access your website more efficiently, because their sessions do not need to go through IPv4 address translation proxies.</p>

<p>Oracle Cloud compute VM instances are initially assigned with only an IPv4 address.<br />
There are 5 steps for enabling IPv6 on the VM:</p>

<p>Assign IPv6 CIDR block to the Virtual Cloud Network.<br />
Assign IPv6 CIDR block to the Subnet.<br />
Configure IPv6 Route Rule.<br />
Assign IPv6 Address to the compute VM's VNIC.<br />
Configure firewall rules.<br />
We will perform steps 1~4 now, and do step 5 a little later (in "Configure Ingress and Egress Rules" section).</p>

<p>Looking at the "Instance Details" page, click the link next to "Virtual cloud network".<br />
This takes us to the "Virtual Cloud Network Details" page.</p>

<p>Select "CIDR Blocks" tab on the left side "Resources" menu, and then click Add IPv6 CIDR Block button.<br />
You will be asked to confirm that you want to enable IPv6.<br />
When you click Confirm, a /56 block of 4,722,366,482,869,645,213,696 IPv6 addresses are automatically allocated to your Virtual Cloud Network (IPv6 step 1).</p>

<p>CIDR Blocks</p>

<p>Select "Subnets" tab on the left side "Resources" menu.<br />
You should see an existing Subnet.<br />
It would have an IPv4 CIDR Block, but the "IPv6 CIDR Block" column is blank.<br />
Click the ⋮ button in the rightmost column, and select "Edit" in the dropdown menu.<br />
Then, check Enable IPv6 CIDR Block box, enter two hexadecimal digits (such as 00) in the box just before "::/64", and click Save Changes (IPv6 step 2).</p>

<p>IPv6 CIDR Block</p>

<p>Select "Route Tables" tab on the left side "Resources" menu, and then click Default Route Table link.<br />
This takes us to the "Route Table Details" pages.<br />
In the "Route Rules" tables, we can see that there's a route rule for destination 0.0.0.0/0 that targets the Internet gateway, which allows IPv4 packets to reach the Internet.<br />
We need a similar route rule for IPv6.<br />
Click Add Route Rules button.<br />
In the popup dialog, enter the following:</p>

<p>Protocol Version: IPv6<br />
Target Type: Internet Gateway<br />
Destination CIDR Block: ::/0<br />
Target Internet Gateway: Internet gateway vcn-…<br />
Then click Add Route Rules button (IPv6 step 3).</p>

<p>Finally, go back to the "Instance Details" page of the compute VM instance.<br />
To find that page, you can type "Instances" into the search bar and select "Services - Instances (Compute)" in the results.</p>

<p>Select "Attached VNICs" tab on the left side "Resources" menu, and then click the link next to (Primary VNIC).<br />
This opens the "VNIC Details".<br />
Select "IPv6 Addresses" tab on the left side "Resources" menu, and click Assign IPv6 Address button.<br />
In the popup dialog, click Assign button to get a random IPv6 address (IPv6 step 4).</p>

<p>DNS<br />
Now that we have the IP addresses assigned, it is a good time to add DNS records to our compute VM instance, so that we can activate HTTPS later.<br />
Two DNS records are required: an A record for the public IPv4 address and an AAAA record for the public IPv6 address.<br />
You can find both addresses in the "VNIC Details" page, as described above.</p>

<p>DNS record</p>

<p>Configure Ingress and Egress Rules<br />
Oracle Cloud has a strict firewall that, by default, only allows SSH access.<br />
In order to host a website, it is necessary to configure the firewall so that it allows HTTP traffic.</p>

<p>To access the firewall configuration page, click the "subnet" name in "Primary VNIC" section of "Instance Details" page.<br />
Then, on "Subnet Details" page, click "Default Security List for …" in "Security Lists" section.<br />
Click Add Ingress Rules button, and enter these four rules in the popup dialog:</p>

<p>Allow HTTP/1.1 and HTTP/2 (IPv4)</p>

<p>stateless: no<br />
source CIDR: 0.0.0.0/0<br />
IP protocol: TCP<br />
destination port range: 80,443<br />
Allow HTTP/1.1 and HTTP/2 (IPv6)</p>

<p>stateless: no<br />
source CIDR: ::/0<br />
IP protocol: TCP<br />
destination port range: 80,443<br />
Allow HTTP/3 (IPv4)</p>

<p>stateless: no<br />
source CIDR: 0.0.0.0/0<br />
IP protocol: UDP<br />
destination port range: 443<br />
Allow HTTP/3 (IPv6)</p>

<p>stateless: no<br />
source CIDR: ::/0<br />
IP protocol: UDP<br />
destination port range: 443<br />
After that, you should see the following ingress rules in the table:</p>

<p>Virtual Cloud Networks - Ingress Rules</p>

<p>You should also add an IPv6 egress rule, so that the VM instance can reach Internet resources over IPv6.<br />
To do that, select "Egress Rules" tab on the left side "Resources" menu.<br />
Click Add Egress Rules button, and enter the following rule in the popup dialog (IPv6 step 5):</p>

<p>Allow IPv6 Internet access<br />
stateless: no<br />
destination CIDR: ::/0<br />
IP protocol: All Protocols</p>

<p>Install HTTP Server<br />
With the firewall rules in place, we are ready to install an HTTP server.<br />
In this guide, I'm installing Caddy HTTP server along with PHP-FPM.<br />
They can be installed from Caddy package repository and ondrej/php PPA respectively.</p>

<h1>see "Caddy package repository" link above for how to add Caddy APT repository</h1>

<p>sudo add-apt-repository ppa:ondrej/php<br />
sudo apt install caddy php8.1-fpm<br />
Before we can start the HTTP server, there's one more firewall to configure: the local iptables.<br />
Oracle Cloud not only has an external firewall at subnet level, but also blocks traffic in iptables INPUT chain.<br />
We can setup a systemd service to insert iptables rules before Caddy starts:</p>

<p>sudoedit /etc/systemd/system/caddy-iptables.service<br />
  (paste the caddy-iptables.service content)</p>

<p>sudo systemctl daemon-reload<br />
sudo systemctl enable --now caddy-iptables<br />
The systemd unit file caddy-iptables.service should have the following content:</p>

<p>[Unit]<br />
Description=Firewall rules for Caddy<br />
Before=caddy.service</p>

<p>[Service]<br />
ExecStartPre=+/usr/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT<br />
ExecStartPre=+/usr/sbin/iptables -I INPUT -p tcp --dport 443 -j ACCEPT<br />
ExecStartPre=+/usr/sbin/iptables -I INPUT -p udp --dport 443 -j ACCEPT<br />
ExecStartPre=+/usr/sbin/ip6tables -I INPUT -p tcp --dport 80 -j ACCEPT<br />
ExecStartPre=+/usr/sbin/ip6tables -I INPUT -p tcp --dport 443 -j ACCEPT<br />
ExecStartPre=+/usr/sbin/ip6tables -I INPUT -p udp --dport 443 -j ACCEPT<br />
ExecStart=true<br />
RemainAfterExit=yes<br />
ExecStopPost=+/usr/sbin/iptables -D INPUT -p tcp --dport 80 -j ACCEPT<br />
ExecStopPost=+/usr/sbin/iptables -D INPUT -p tcp --dport 443 -j ACCEPT<br />
ExecStopPost=+/usr/sbin/iptables -D INPUT -p udp --dport 443 -j ACCEPT<br />
ExecStopPost=+/usr/sbin/ip6tables -D INPUT -p tcp --dport 80 -j ACCEPT<br />
ExecStopPost=+/usr/sbin/ip6tables -D INPUT -p tcp --dport 443 -j ACCEPT<br />
ExecStopPost=+/usr/sbin/ip6tables -D INPUT -p udp --dport 443 -j ACCEPT</p>

<p>[Install]<br />
RequiredBy=caddy.service<br />
Upload your website content, and make sure the www-data group can access them.<br />
In this example, I'll create two simple files:</p>

<p>sudo mkdir -p /var/www/html<br />
echo '</p>

<h1>hello</h1>

<p>' | sudo tee /var/www/html/index.html<br />
echo '&lt;?php phpinfo(); ?&gt;' | sudo tee /var/www/html/phpinfo.php<br />
sudo chgrp -R www-data /var/www/html<br />
Edit the Caddyfile (/etc/caddy/Caddyfile), paste the following:<br />
(change the domain name and root directory as appropriate)</p>

<p>{<br />
  servers {<br />
    protocol {<br />
      experimental_http3<br />
    }<br />
  }<br />
}</p>

<p><a href="https://demo.example.com" rel="nofollow">https://demo.example.com</a> {<br />
  root * /var/www/html<br />
  file_server<br />
  php_fastcgi unix//run/php/php8.1-fpm.sock</p>

<p>header {<br />
    Strict-Transport-Security max-age=2592000<br />
    X-Frame-Options SAMEORIGIN<br />
    X-Content-Type-Options nosniff<br />
    Referrer-Policy no-referrer-when-downgrade<br />
  }<br />
}<br />
Finally, restart the webserver for the settings to take effect:</p>

<p>sudo systemctl restart caddy<br />
sudo systemctl restart php8.1-fpm</p>

<p>Test the Website<br />
To confirm everything is working, we can visit the index page <a href="https://demo.example.com/" rel="nofollow">https://demo.example.com/</a> and the PHP script <a href="https://demo.example.com/phpinfo.php" rel="nofollow">https://demo.example.com/phpinfo.php</a> in the browser.</p>

<p>Then, we use the curl command line tool (on a different machine) to check that:</p>

<p>HTTP-to-HTTPS redirect is working properly.<br />
The website is served over HTTP/1.0, HTTP/1.1, HTTP/2, and HTTP/3.<br />
The server is accessible over both IPv4 and IPv6.<br />
$ curl -4 --http1.0 -I <a href="http://demo.example.com/" rel="nofollow">http://demo.example.com/</a><br />
HTTP/1.0 308 Permanent Redirect<br />
Connection: close<br />
Location: <a href="https://demo.example.com/" rel="nofollow">https://demo.example.com/</a><br />
Server: Caddy<br />
Date: Fri, 28 Jan 2022 02:16:43 GMT</p>

<p>$ curl -6 --http1.0 -I <a href="http://demo.example.com/" rel="nofollow">http://demo.example.com/</a><br />
HTTP/1.0 308 Permanent Redirect<br />
Connection: close<br />
Location: <a href="https://demo.example.com/" rel="nofollow">https://demo.example.com/</a><br />
Server: Caddy<br />
Date: Fri, 28 Jan 2022 02:16:43 GMT</p>

<p>$ curl -4 --http1.1 -I <a href="http://demo.example.com/" rel="nofollow">http://demo.example.com/</a><br />
HTTP/1.1 308 Permanent Redirect<br />
Connection: close<br />
Location: <a href="https://demo.example.com/" rel="nofollow">https://demo.example.com/</a><br />
Server: Caddy<br />
Date: Fri, 28 Jan 2022 02:16:44 GMT</p>

<p>$ curl -6 --http1.1 -I <a href="http://demo.example.com/" rel="nofollow">http://demo.example.com/</a><br />
HTTP/1.1 308 Permanent Redirect<br />
Connection: close<br />
Location: <a href="https://demo.example.com/" rel="nofollow">https://demo.example.com/</a><br />
Server: Caddy<br />
Date: Fri, 28 Jan 2022 02:16:44 GMT</p>

<p>$ curl -4 --http1.1 -I <a href="https://demo.example.com/" rel="nofollow">https://demo.example.com/</a><br />
HTTP/1.1 200 OK<br />
Accept-Ranges: bytes<br />
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000<br />
Content-Length: 15<br />
Content-Type: text/html; charset=utf-8<br />
Etag: "r6edtff"<br />
Last-Modified: Fri, 28 Jan 2022 02:05:39 GMT<br />
Referrer-Policy: no-referrer-when-downgrade<br />
Server: Caddy<br />
Strict-Transport-Security: max-age=2592000<br />
X-Content-Type-Options: nosniff<br />
X-Frame-Options: SAMEORIGIN<br />
Date: Fri, 28 Jan 2022 02:16:45 GMT</p>

<p>$ curl -6 --http1.1 -I <a href="https://demo.example.com/" rel="nofollow">https://demo.example.com/</a><br />
HTTP/1.1 200 OK<br />
Accept-Ranges: bytes<br />
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000<br />
Content-Length: 15<br />
Content-Type: text/html; charset=utf-8<br />
Etag: "r6edtff"<br />
Last-Modified: Fri, 28 Jan 2022 02:05:39 GMT<br />
Referrer-Policy: no-referrer-when-downgrade<br />
Server: Caddy<br />
Strict-Transport-Security: max-age=2592000<br />
X-Content-Type-Options: nosniff<br />
X-Frame-Options: SAMEORIGIN<br />
Date: Fri, 28 Jan 2022 02:16:45 GMT</p>

<p>$ curl -4 --http2 -I <a href="https://demo.example.com/" rel="nofollow">https://demo.example.com/</a><br />
HTTP/2 200<br />
accept-ranges: bytes<br />
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000<br />
content-type: text/html; charset=utf-8<br />
etag: "r6edtff"<br />
last-modified: Fri, 28 Jan 2022 02:05:39 GMT<br />
referrer-policy: no-referrer-when-downgrade<br />
server: Caddy<br />
strict-transport-security: max-age=2592000<br />
x-content-type-options: nosniff<br />
x-frame-options: SAMEORIGIN<br />
content-length: 15<br />
date: Fri, 28 Jan 2022 02:16:46 GMT</p>

<p>$ curl -6 --http2 -I <a href="https://demo.example.com/" rel="nofollow">https://demo.example.com/</a><br />
HTTP/2 200<br />
accept-ranges: bytes<br />
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000<br />
content-type: text/html; charset=utf-8<br />
etag: "r6edtff"<br />
last-modified: Fri, 28 Jan 2022 02:05:39 GMT<br />
referrer-policy: no-referrer-when-downgrade<br />
server: Caddy.</p>

<p>strict-transport-security: max-age=2592000<br />
x-content-type-options: nosniff<br />
x-frame-options: SAMEORIGIN<br />
content-length: 15<br />
date: Fri, 28 Jan 2022 02:16:46 GMT</p>

<p>$ docker run -t --rm --network host ymuski/curl-http3 curl -4 --http3 -I <a href="https://demo.example.com/" rel="nofollow">https://demo.example.com/</a><br />
HTTP/3 200<br />
server: Caddy<br />
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000<br />
x-content-type-options: nosniff<br />
last-modified: Fri, 28 Jan 2022 02:05:39 GMT<br />
content-type: text/html; charset=utf-8<br />
accept-ranges: bytes<br />
content-length: 15<br />
referrer-policy: no-referrer-when-downgrade<br />
strict-transport-security: max-age=2592000<br />
x-frame-options: SAMEORIGIN<br />
etag: "r6edtff"</p>

<p>$ docker run -t --rm --network host ymuski/curl-http3 curl -6 --http3 -I <a href="https://demo.example.com/" rel="nofollow">https://demo.example.com/</a><br />
HTTP/3 200<br />
x-frame-options: SAMEORIGIN<br />
etag: "r6edtff"<br />
accept-ranges: bytes<br />
content-length: 15<br />
server: Caddy<br />
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000<br />
referrer-policy: no-referrer-when-downgrade<br />
strict-transport-security: max-age=2592000<br />
x-content-type-options: nosniff<br />
content-type: text/html; charset=utf-8<br />
last-modified: Fri, 28 Jan 2022 02:05:39 GMT<br />
Finally, we use SSL Server Test to verify that TLS certificates and crypto are configured securely, and use Security Headers to check that HTTP Strict Transport Security is setup correctly.</p>

<p>Conclusion<br />
This article explains how to deploy a website in a VM instance on Oracle Cloud Free Tier.<br />
It involves the following steps:</p>

<p>Create an always free compute VM instance.<br />
Enable IPv6 in the Virtual Cloud Network, subnet, and VM instance.<br />
Add ingress and egress rules in the network Security List.<br />
Install Caddy HTTP server and PHP.<br />
Configure local iptables firewall.<br />
Test the website installation.</p>

<hr />

<p>This post is originally published on yoursunny.com blog, not written by myself:<br />
<a href="https://yoursunny.com/t/2020/OracleCloud-website/" rel="nofollow">https://yoursunny.com/t/2020/OracleCloud-website/</a></p>
]]>
        </description>
    </item>
<div class="SFBox SFVCBox"><span>Online Since</span>April 2004</div><div class="SFBox SFVCBox"><span>Total Views</span>3.1M</div><div class="SFBox SFUBox"><span>Total Users</span>3.7M</div><div class="SFBox SFTBox"><span>Total Topics</span>7.8K</div><div class="SFBox SFPBox"><span>Post Count</span>33.3K</div>   </channel>
</rss>
