Vai al contenuto principale

Oracle Cloud Always Free

Install the gateway on a free Oracle Cloud instance: create the instance, open ports 80 and 443 at both filtering levels, point a domain at it, then run the installation command.

Oracle Cloud's Always Free tier gives you a small server at no monthly cost. The gateway fits on it comfortably: it needs no database server and no other service, and it runs on the ARM processors of the free instances.

In short, once the instance is created, the domain points at it and ports 80 and 443 are open at both levels:

curl -fsSL https://sms-gateway.araylab.com/install.sh | sudo bash -s -- --domain sms.example.com --yes

This page only covers what is specific to Oracle. The full path (purchase, key, first account, activation, pairing) is in Installation.

The Oracle console changes often. The steps below describe what to do, not the exact labels of the screens. The resources included in the free tier and Oracle's rules on idle instances are set by Oracle: check them on its site before you start.

Why this tier fits

Point What it means for you
ARM processor (Ampere A1) The gateway is published for ARM (arm64) as well as amd64: Docker picks the right one
Little memory needed The gateway uses very little memory, and nothing else runs next to it apart from a small HTTPS server
Nothing to compile The gateway is downloaded ready to run
Reachable from the internet Phones connect from anywhere, 4G included, over HTTPS

Step 1: create the instance

In the Oracle console, create a compute instance:

  • Shape: an Ampere A1 shape (ARM), the most generous in the free tier. A free x86 shape also works, but it is much more modest.
  • Image: a recent Ubuntu or Oracle Linux. The gateway does not depend on the distribution.
  • SSH key: keep the key offered at creation, you will need it to connect.

Note the public IP address of the instance.

Step 2: open the ports, at two levels

This is what most often goes wrong on Oracle Cloud: traffic is filtered twice, and a port must be open at both levels to be reachable.

Level Where What to open
The virtual network (Security List or Network Security Group) Oracle console, network of the instance, ingress rules TCP 80 and 443 from 0.0.0.0/0
The firewall of the instance On the instance itself, over SSH TCP 80 and 443

On Oracle's Ubuntu images, the local firewall is usually made of saved iptables rules:

sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 443 -j ACCEPT
sudo netfilter-persistent save

On Oracle Linux, it is firewalld:

sudo firewall-cmd --permanent --add-service=http --add-service=https
sudo firewall-cmd --reload

These are commands of the operating system, not of the gateway. If a port looks open in the console but stays unreachable, it is almost always the firewall of the instance.

Do not open port 8080. In domain mode, the gateway only listens inside the instance; the HTTPS server in front of it is the only thing exposed, on 80 and 443. Port 80 must stay open even if all useful traffic goes over HTTPS: it is used to obtain and renew the certificate.

Step 3: the domain name

Create a DNS A record pointing at the public IP address of the instance (a subdomain such as sms.your-company.com is enough), then check:

dig +short sms.example.com

The answer must be the IP address of the instance. A domain name is required here: without one, only local network mode remains, which assumes phones on the same network as the machine, which is never the case for a cloud instance.

Step 4: install

Over SSH on the instance (the user is ubuntu or opc depending on the image):

curl -fsSL https://sms-gateway.araylab.com/install.sh | sudo bash -s -- --domain sms.example.com --yes

The script installs Docker, checks that the domain points at the instance, starts the gateway and its HTTPS server, then shows the dashboard address and the setup code (sms-gateway setup-code shows it again as long as no account exists). All the options of the command, with their defaults, are in Installation.

Check:

sms-gateway status
curl -fsS https://sms.example.com/health

Then open https://sms.example.com and continue with Installation, step 4.

If the certificate is not obtained

The browser reports an invalid certificate, or the site does not open over HTTPS. Read the logs of the HTTPS server:

sms-gateway logs caddy

In almost every case, port 80 is closed at one of the two levels of step 2, or the domain does not point at the instance yet. Fix the cause, then sms-gateway restart.

Keep your data safe

  • Oracle may reclaim a free instance it considers idle, under the terms of its offer. Keep a backup outside the instance.
  • The automatic backup stays on the instance. The gateway backs up its database every night, but on the instance itself: copy a backup elsewhere regularly, see VPS, back up off the machine and Backup and restore.
  • To move to another machine later, see Migrating to another server.

Command recap

# On the instance, after opening 80 and 443 at both levels and setting up the DNS
curl -fsSL https://sms-gateway.araylab.com/install.sh | sudo bash -s -- --domain sms.example.com --yes

# Check
sms-gateway status
curl -fsS https://sms.example.com/health
sms-gateway logs

# Later
sms-gateway update
sms-gateway backup

Cerca nella documentazione

Digita alcune parole, poi scegli una pagina.