Oracle Cloud’s Free Tier offers a limited set of resources that you can use for personal projects, including running Docker apps like ERPNext. Oracle’s Free Tier includes two always-free cloud services: compute instances and a set of storage options. Here’s a detailed guide on how you can set up a Docker app like ERPNext with a custom domain using Oracle Cloud’s Free Tier:

1. Sign up for Oracle Cloud Free Tier

  • Visit Oracle Cloud’s Free Tier and create an account.
  • You’ll get access to 2 virtual machines (VMs) with 1GB of memory each and 100GB of block storage (subject to availability).
  • After registration, log in to the Oracle Cloud Console.

2. Create a Virtual Machine (VM) for Hosting Docker

  • In the Oracle Cloud console, navigate to ComputeInstancesCreate Instance.
  • Select the Always Free VM configuration (usually 1 OCPU, 1 GB RAM).
  • Choose a Linux OS (e.g., Ubuntu).
  • Configure networking (choose the Virtual Cloud Network for default setup).

3. Install Docker on the VM

  • Once the VM is up and running, SSH into the VM.
  • Run the following commands to install Docker:
    sudo apt update
    sudo apt install -y docker.io
    sudo systemctl enable --now docker
    sudo usermod -aG docker $USER
  • Verify Docker installation:
    docker --version

4. Deploy ERPNext (or Similar Docker App)

  • You can deploy ERPNext using the official Docker image. Here’s how to do it:
    docker pull frappe/erpnext
    docker run -d -p 8000:8000 frappe/erpnext
  • This will pull the ERPNext Docker image and start the app on port 8000.

5. Set Up Nginx as a Reverse Proxy (Optional for Domain Use)

  • If you want to use a custom domain (like erpnext.yourdomain.com), you’ll need to set up a reverse proxy with Nginx.
    sudo apt install -y nginx
  • Configure Nginx: Edit the config file:
    sudo nano /etc/nginx/sites-available/erpnext

    Add the following configuration:

    server {
    listen 80;
    server_name erpnext.yourdomain.com;

    location / {
    proxy_pass http://localhost:8000;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
    }

  • Enable the configuration:
    sudo ln -s /etc/nginx/sites-available/erpnext /etc/nginx/sites-enabled/
    sudo systemctl restart nginx

6. Point Your Domain to the Oracle Cloud VM

  • In your domain registrar’s DNS settings, point the domain to your Oracle VM’s public IP address (found in the Oracle Cloud Console under the Networking section).
  • For example, create an A record like:
    erpnext IN A <your_oracle_vm_ip>

7. Access ERPNext via Your Domain

  • After DNS propagation, you should be able to access ERPNext through erpnext.yourdomain.com.

8. Can You Use It Long-Term for Free?

  • Yes, Oracle’s Always Free services are available for personal use with the limitations of free-tier resources.
  • As long as you stay within the free-tier limits, you won’t incur charges. However, if you exceed the allocated resources (e.g., memory, storage), you will be charged.

9. Monitor and Scale if Needed

  • You can monitor your resource usage in the Oracle Cloud Console and scale your services if needed by upgrading or switching to a paid tier.

This setup will allow you to host Dockerized applications like ERPNext for free, but keep an eye on the resource limits to ensure you don’t incur unexpected charges. Let me know if you need help with any of these steps!