Skip to content

Instantly share code, notes, and snippets.

@bruce-willis
Last active August 2, 2024 11:14
Show Gist options
  • Save bruce-willis/ace946bdbc5f63b1b877f77c37240cc2 to your computer and use it in GitHub Desktop.
Save bruce-willis/ace946bdbc5f63b1b877f77c37240cc2 to your computer and use it in GitHub Desktop.
How to setup YunoHost at Oracle free tier VM (works on AMD and ARM servers)
  1. Register for Oracle Cloud Free Tier
  2. Create compute instance
    • change image to Canonical Ubuntu
    • confirm that a public IPv4 address is assigned
    • upload your public ssh key
    • leave everything blank in Boot volume
  3. Enable Internet Access
    • Instances → Instance details → Subnet → Default Security List → Add Ingress Rules
    • HTTP: Stateless: Checked Source Type: CIDR Source CIDR: 0.0.0.0/0 IP Protocol: TCP Source port range: (leave-blank) Destination Port Range: 80 Description: Allow HTTP connections
    • HTTPs: Stateless: Checked Source Type: CIDR Source CIDR: 0.0.0.0/0 IP Protocol: TCP Source port range: (leave-blank) Destination Port Range: 443 Description: Allow HTTPs connections
  4. Connect to your ubuntu machine via ssh: ssh ubuntu@<your public IPv4 address> and install firewall software
    • update apt list: sudo apt update
    • install firewalld: sudo apt install firewalld -y
    • enable HTTP connection through port 80: sudo firewall-cmd --add-service=http --permanent
    • enable HTTPS connections on port 443: sudo firewall-cmd --add-service=https --permanent
    • reload the firewall: sudo firewall-cmd --reload
    • you can check that port is opened via sudo python3 -m http.server 80 and opening your public IPv4 address in a browser
  5. Install debian using this script:
    • curl -fLO https://raw.githubusercontent.com/bohanyang/debi/master/debi.sh
    • chmod a+rx debi.sh
    • sudo ./debi.sh --version 11. If you have your public key uploaded somewhere (e.g., github), you can add --authorized-keys-url https://github.com/<github username>.keys to the command. Otherwise you can always upload it later via ssh-copy-id
    • sudo shutdown -r now
  6. You need to wait around 5-7 minutes now.
  7. Update known host authorization: ssh-keygen -R <your public IPv4 address>
  8. Connect to newly created debian via ssh: ssh debian@<your public IPv4 address>
    • install some packages: sudo apt update && sudo apt install htop curl unzip tmux -y
    • start tmux session: tmux new -s yuno
    • become root: sudo -i
  9. Install YunoHost:
    • run install script: curl https://install.yunohost.org | bash
    • open your public IPv4 address in a browser and proceed with the initial configuration
  10. Note: next time you should connect to this machine via ssh admin@<your public IPv4 address> and use password from previus step. You can copy your public key later.
  11. Optional For complete setup of YunoHost you need to open a couple more ports (5222, 5269, 25, 587, 993) the same way from second step. More info

P.S. I am not sure that third step is necessary.

@rubenlauren327
Copy link

THANKS!!!!!

@MohamedElashri
Copy link

MohamedElashri commented Aug 13, 2022

Yunohost requires Debian 11

So replace

sudo ./debi.sh --version 10 --authorized-keys-url https://github.com/<github username>.keys

with

sudo ./debi.sh --version 11 --authorized-keys-url https://github.com/<github username>.keys

Otherwise, you will have to upgrade after installation from debian 10 to debian 11 manually.

Thanks for the guide, it was very useful.

@Th3R3dL4rv4
Copy link

Will this work on an Ampere Server (ARM64)? I lost in sudo ./debi.sh --version 10 --authorized-keys-url https://github.com/<github username>.keys. Is this the private key that was downloaded before creating the instance?

@utkarshsethi
Copy link

Will this work on an Ampere Server (ARM64)? I lost in sudo ./debi.sh --version 10 --authorized-keys-url https://github.com/<github username>.keys. Is this the private key that was downloaded before creating the instance?

The link is to any public keys you might have uploaded to github, to allow you ssh access to the server. You can do the same thing manually by using ssh-copy-id -f -i locationToPubKey/publicKeyName.pub serverusername@serverip/hostname

and yes it works for ARM64

@Th3R3dL4rv4
Copy link

I got this error after waiting for my instance to reboot.

This instance is unresponsive. Confirm that the OS and network are configured correctly, and check the infrastructure health metrics to see determine whether there is an ongoing infrastructure issue.

@Th3R3dL4rv4
Copy link

Th3R3dL4rv4 commented Aug 2, 2024

It works now. I initially had trouble with the SSH keys and had to go through a few trial-and-error attempts. On my sixth attempt, it finally worked.

@bruce-willis
Copy link
Author

@utkarshsethi, Thanks for help! I've updated the script and mention ssh-copy-id now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment