Easily create Oracle Cloud Infrastructure Always Free instances from Discord!
🚀 Quick Start • 📖 Usage • 🔧 Advanced Setup • 🤝 Contributing
English | 한국어
# Example usage in Discord channel
/status # Check bot status and instance overview
/launch # Instantly create Always Free instance
/log count:5 # View last 5 execution logs
/config # Check current configuration╔══════════════════════════════════════════════════════════════════════════════╗
║ 🧙♂️ OCI Always Free Discord Bot ║
║ Setup Wizard ║
║ Oracle Cloud Infrastructure Always Free Instance Auto Creator ║
╚══════════════════════════════════════════════════════════════════════════════╝
ℹ️ [12:34:56] 🎯 Always Free Optimized: E2.1.Micro (2x), A1.Flex (4 OCPU, 24GB)
ℹ️ [12:34:56] 🤖 Discord Integration: Slash commands, Real-time monitoring
ℹ️ [12:34:56] 🔧 Full Automation: Auto-detect config, Real-time validation📊 Always Free Usage:
• Shape: VM.Standard.A1.Flex
• Specs: 2 OCPU, 12GB RAM
• A1 Total Limit: 2/4 OCPU, 12/24GB RAM
• Remaining Resources: 2 OCPU, 12GB RAM
• Boot Volume: 100/200GB (Free)Oracle Cloud Always Free provides powerful cloud infrastructure at no cost forever - perfect for developers, students, and small projects!
|
|
🎯 A1.Flex (ARM) - High Performance Applications
# Minecraft Server (Recommended: 2 OCPU, 8GB)
Shape: VM.Standard.A1.Flex
Config: 2 OCPU, 8GB RAM
Players: ~10-20 concurrent
Performance: Excellent for modded servers# Full Development Stack
Shape: VM.Standard.A1.Flex
Config: 4 OCPU, 24GB RAM
Stack: Docker, Kubernetes, CI/CD
Perfect for: Team development, microservices# Machine Learning Training
Config: 4 OCPU, 24GB RAM
Frameworks: TensorFlow, PyTorch
Use: Model training, data processing⚡ E2.1.Micro (AMD) - Lightweight Services
- Personal websites & blogs
- REST APIs & microservices
- Discord/Telegram bots
- Monitoring services
- Small databases (PostgreSQL, MySQL)
- Redis cache servers
- Message queues
- Log aggregators
| Feature | Always Free | Paid Plans |
|---|---|---|
| Cost | $0/month forever | Pay-as-you-use |
| Performance | Production-ready | Scalable |
| Duration | No time limit | Flexible |
| Support | Community | Professional |
💡 Pro Tip: Always Free is perfect for learning, development, and small production workloads. Scale to paid plans when you need more resources!
|
|
|
|
🎯 Always Free Optimization
- Shape Auto-filtering: Shows only E2.1.Micro, A1.Flex
- Real-time limit check: Auto-calculate OCPU/RAM usage
- Billing protection: Warns when exceeding Always Free limits
- Usage dashboard: Real-time display of remaining resources
🤖 Discord Bot Commands
| Command | Function | Example |
|---|---|---|
/status |
Bot status and instance overview | Uptime, success rate, recent activity |
/launch |
Instant instance creation | Auto-select Always Free Shape |
/log |
View recent execution logs | Success/failure history, error diagnosis |
/config |
Check configuration info | Current Shape, region, specs |
/help |
All commands guide | Usage and tips |
🔧 Smart Setup Wizard
- Auto environment detection: Auto-load existing OCI config files
- Real-time API validation: Real-time query of available Shape/Image
- Custom spec configuration: Auto-validate OCPU/RAM combinations
- Intuitive UI: User-friendly interface
|
|
|
# 🔐 Generate API key pair
mkdir -p ~/.oci
openssl genrsa -out ~/.oci/oci_api_key.pem 2048
openssl rsa -pubout -in ~/.oci/oci_api_key.pem -out ~/.oci/oci_api_key_public.pem
chmod 600 ~/.oci/oci_api_key.pem
# 📋 Copy public key content (for OCI Console registration)
cat ~/.oci/oci_api_key_public.pem🔗 OCI Console Registration Path
Identity & Security→Users→Your Account→API Keys→Add API Key
# 🚀 Install OCI CLI (automatic)
bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"
# 📝 Interactive setup (recommended)
oci setup config
# 🔍 Verify configuration
oci iam region list --output table# 📥 Download scripts
git clone https://github.com/CorelLinux/oci-simple-script.git
cd oci-simple-script
# 🧙♂️ Run setup wizard
bash oci-config-wizard.sh🎉 Once all setup is complete, config.json will be auto-generated!
# 🤖 Start bot
bash oci-script-and-bot.sh
# 📊 Check status
pm2 status
pm2 logs oci-discord-bot| Command | Icon | Description | Result |
|---|---|---|---|
/status |
📊 | Check bot status | Uptime, success rate, recent activity |
/launch |
🚀 | Create instance | Auto-select Always Free Shape |
/log |
📋 | View logs | Recent N execution history |
/config |
⚙️ | Check configuration | Current Shape, region, specs |
/stop |
⏹️ | Stop auto creation | Pause bot |
/start |
Restart auto creation | Resume bot | |
/schedule |
⏰ | Set creation interval | 3-60 minutes (default: 5 min) |
/stats |
📊 | Detailed statistics | Success rate, period analysis |
/instances |
🖥️ | List instances | Running/stopped instance overview |
/resources |
💰 | Resource usage | Always Free limits and usage |
/alert |
🔔 | Notification settings | Configure alerts |
/help |
❓ | Help | All commands guide |
# 🔍 Check current instances
oci compute instance list --compartment-id $COMPARTMENT_ID --output table
# 📊 Check A1.Flex usage
oci limits resource-availability get --compartment-id $COMPARTMENT_ID \
--service-name compute --limit-name vm-standard-a1-core-count| Feature | Description | Benefit |
|---|---|---|
| 🎯 Smart Interval | Default 5-minute attempts | Faster instance acquisition |
| ⚙️ Flexible Timing | 3-60 minute range via /schedule |
Customizable based on demand |
| 🌐 Multi-language | English/Korean support | Better accessibility |
| 🔧 Error Recovery | Improved command error handling | More stable operation |
| 📊 Enhanced Stats | Detailed success rate analysis | Better monitoring |
💡 Pro Tip: Use
/schedule 3during high-demand periods and/schedule 30during low-demand periods to optimize success rates.
💡 Shape Selection Guide
| Shape | OCPU | RAM | Instances | Use Case | Notes |
|---|---|---|---|---|---|
| E2.1.Micro | 1 | 1GB | 2 | Lightweight web servers, bots | AMD-based |
| A1.Flex | 1-4 | 6-24GB | 1-4 | Development servers, learning | ARM-based |
💰 Cost Calculator:
- E2.1.Micro: Free (up to 2)
- A1.Flex: Total 4 OCPU, 24GB RAM free
- Boot Volume: 200GB free
🔧 Custom SSH Keys
# 🔑 Use existing SSH keys
export CUSTOM_PRIVATE_KEY_PATH="/path/to/your/private_key"
export CUSTOM_PUBLIC_KEY_PATH="/path/to/your/public_key.pub"
# 🔐 Generate new SSH keys
ssh-keygen -t rsa -b 2048 -f ~/.ssh/oci_key -N ""
export CUSTOM_PRIVATE_KEY_PATH="$HOME/.ssh/oci_key"
export CUSTOM_PUBLIC_KEY_PATH="$HOME/.ssh/oci_key.pub"🌐 Language Configuration
The bot supports both English and Korean interfaces. Configure in config.json:
{
"LANGUAGE": "en", // "en" for English, "ko" for Korean
// ... other config options
}Language Features:
- 🎯 Discord command descriptions in chosen language
- 📝 Bot response messages in chosen language
- 🔧 Error messages and help text localized
- 🚀 Seamless switching - just edit config and restart
Change Language:
# Edit config.json
nano config.json
# Change "LANGUAGE": "ko" to "LANGUAGE": "en"
# Restart bot
pm2 restart oci-discord-bot🚨 Common Issues
# 🔍 Check installation
oci --version
# 🔧 Check PATH configuration
echo $PATH | grep -o "$HOME/bin"
# 🔄 Reinstall
curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh | bashWhen OCI CLI is installed via symlink in user path, it may not be accessible with sudo.
# 🔍 Check OCI CLI installation location
which oci
# Result: /home/user/bin/oci
# 🔧 Create symlink in system path
sudo ln -s $(which oci) /usr/local/bin/oci
# ✅ Verify sudo access
sudo oci --versionAutomatic Solution:
# Script handles this automatically, but manual setup is also possible
sudo ln -s $HOME/bin/oci /usr/local/bin/oci
sudo ln -s $HOME/.local/bin/oci /usr/local/bin/oci
sudo ln -s $HOME/lib/oracle-cli/bin/oci /usr/local/bin/oci# 🔐 Check and fix permissions
ls -la ~/.oci/
chmod 600 ~/.oci/oci_api_key.pem
chmod 644 ~/.oci/oci_api_key_public.pem
# 🔍 Validate key
oci iam region list --auth api_key# 🔍 Check token
grep -o "discord_token" config.json
# 🔧 Reset token
bash oci-config-wizard.sh
# Re-run Discord configuration section only- 🔄 Try different regions:
ap-tokyo-1,ap-mumbai-1 - ⏰ Change time zone: Recommended during early morning hours
- 🎯 Change Shape: E2.1.Micro → A1.Flex
📊 Status Check Commands
# 🤖 Bot status
pm2 status
pm2 logs oci-discord-bot --lines 50
# 📊 Instance list
oci compute instance list --compartment-id $COMPARTMENT_ID --output table
# 💰 Always Free usage
oci limits resource-availability get \
--compartment-id $COMPARTMENT_ID \
--service-name compute \
--limit-name vm-standard-a1-core-count🔧 Configuration File Check
# 📄 OCI configuration
cat ~/.oci/config
# 📋 Bot configuration
cat config.json | jq .
# 📝 Log file
tail -f oci_bot.log| Category | Link | Description |
|---|---|---|
| 🏛️ Official | Oracle Cloud Console | OCI Management Console |
| 📖 Documentation | OCI CLI Guide | Official Installation Guide |
| 🤖 Bot | Discord Developer | Bot Creation and Management |
| 💡 Tips | Out of Capacity Solution | Capacity shortage solution |
- OCI Basics: Getting Started with Oracle Cloud Infrastructure
- Discord.js: Official Guide
- PM2: Process Management Guide
|
🐛 Bug Reports |
💡 Feature Requests |
🔧 Code Contributions |
- 🍴 Fork this repository to your account
- 🌿 Branch Create a new feature branch
- 💻 Code Write improvements and test
- 📝 Commit Write clear commit messages
- 🚀 PR Create Pull Request