← Back to Blog

Moving a Discord bot from AWS to Oracle Cloud Free

· 1 min read

  • oracle cloud
  • node.js
  • pm2
  • devops

My shop’s Discord bot used to run on a 1 GB AWS instance. I moved it to an ARM Ampere A1 machine (4 cores, 24 GB RAM) on Oracle Cloud’s Always Free tier. Here’s what I learned.

1. There are two firewalls

Oracle blocks ports in the virtual network’s Security List, and the Ubuntu image ships with iptables rules that block everything except port 22. Opening a port in one place isn’t enough.

Tip: connection refused usually means the in-machine firewall; a timeout usually means the Security List.

2. Run long commands inside tmux

Cloud Shell disconnects often. Running the installer inside tmux keeps it going even when the connection drops:

tmux new -s setup       # new session
tmux attach -t setup    # reattach

Hard-won lesson: don’t re-run an installer that is still running inside tmux — two overlapping installs broke the configuration.

3. Never run the bot in two places

The same Discord token on two machines makes the bot reply twice. Safe order: prepare the new machine → stop the old bot → copy data → start the new bot → switch the address on the website.

4. Stay within the free tier

  • Free block storage is 200 GB in total — make sure no stray volumes are left.
  • Set a 1 USD Budget with an email alert.

Result: a stable bot, 24× more RAM, zero cost.