Created [Community] Immich OCI Free Tier ARM Ubuntu 22.04 VM Tutorial by Jay2 (markdown)

Alex 2022-08-04 20:45:54 -05:00
parent a15361d660
commit b995d68f61

@ -0,0 +1,233 @@
This tutorial is intended for both Oracle Cloud and Linux command line beginners, all steps and commands will be included.
When youve finished these steps, youll have an always-free virtual machine that you can access from anywhere with a 2.4Ghz quad-core ARM64 CPU, 24GB RAM, 200GB SSD, and 4Gbps connectivity, 10TB per month outgoing traffic, and Unlimited incoming traffic.
## What Youll Need:
* [PuTTY (free)](https://the.earth.li/~sgtatham/putty/latest/w64/putty-64bit-0.77-installer.msi)
* [Oracle Cloud Infrastructure (“OCI”) Account (Credit Card Required - You will never be billed if you follow this guide)](https://www.oracle.com/ca-en/cloud/free/)
## Steps:
1. Sign in to OCI and click the hamburger menu
![image8](https://user-images.githubusercontent.com/27055614/182982455-cb35f7a1-ae98-4d8e-8a06-028d8e7c7b69.png)
2. Select Compute and then Instances
![image16](https://user-images.githubusercontent.com/27055614/182982523-ae8f4767-f194-4a96-872b-d095cac0cc98.png)
3. Click Create Instance
![image1](https://user-images.githubusercontent.com/27055614/182982584-94fa4482-66cb-447b-b7e9-f750581ccc2c.png)
4. On the Create compute instance page, make the following changes:
* Placement
* Leave as default.
* Image and shape
* Click the Edit button on the Image section
* Click the "Change image" button
* Choose "Canonical Ubuntu"
* Click the Select image button
![image25](https://user-images.githubusercontent.com/27055614/182982764-0ee90a97-41a0-4bb4-959e-dc624949a54a.png)
* Click the Change Shape button on the Shape section
* Click the Change shape button
* Choose Ampere
* Select VM.Standard.A1.Flex
* Drag Number of OCPUs slider to 4
* Drag Amount of memory (GB) slider to 24
* Click Select shape button
![image23](https://user-images.githubusercontent.com/27055614/182982873-1772a5e2-3d17-4d05-9da7-a817fa7a4815.png)
* Networking
* Leave as default.
* Add SSH keys
* Click on the Paste public keys radial button
![image3](https://user-images.githubusercontent.com/27055614/182982924-ae6442df-a258-415e-b30f-75c786ee2913.png)
* Install PuTTY if you havent already and open PuTTYGen.
![image15](https://user-images.githubusercontent.com/27055614/182982977-cd6df284-4a09-45c2-b387-f4101300a5a5.png)
* Click the Generate button and move the mouse randomly until the green bar is full.
![image12](https://user-images.githubusercontent.com/27055614/182982998-ff4b0564-bef8-4d79-8e15-13fc19a76c10.png)
* Select All of the text (right-click Select All) in the PuTTYGen Public key for pasting… text box
![image13](https://user-images.githubusercontent.com/27055614/182983127-64ac8811-d5dc-4fe8-99ab-49a2f264bfee.png)
* Copy to clipboard (right-click Copy)
![image28](https://user-images.githubusercontent.com/27055614/182983208-e40de265-48c7-4e25-8171-31f27bbe7afe.png)
* Paste (right-click Paste) in to the SSH keys text box on the OCI Add SSH keys section
![image9](https://user-images.githubusercontent.com/27055614/182983231-e39eaee1-87f8-4de1-a6b2-3b558faffa0e.png)
* In PuTTYGen window, click Save private key button. Choose whatever file name you want and save this file in a safe place. PuTTYGen will ask you if youre sure you want to save without a passphrase - choose Yes.
![image21](https://user-images.githubusercontent.com/27055614/182983250-1210ca05-c03d-4c1f-a4f3-0bb39071e303.png)
![image21](https://user-images.githubusercontent.com/27055614/182983270-ec7685c4-e4df-4fe6-8355-9bb875b5b2b1.png)
5. Boot Volume
* Click Specify a custom boot volume size
* Enter 200 in Boot volume size (GB) text box
* Click Create button
![image14](https://user-images.githubusercontent.com/27055614/182983333-6e130542-5819-4335-b248-72c04d285291.png)
6. Wait 1-2 minutes for VM provisioning to complete. When complete, yellow provisioning box will turn green. Once green, you can proceed with next steps.
![image2](https://user-images.githubusercontent.com/27055614/182983365-45ffeb36-192a-45ef-bcbe-ca0647f2b963.png)
7. In the Primary VNIC section, click link beside Subnet:
![image27](https://user-images.githubusercontent.com/27055614/182983381-89c2c48b-6c14-4c49-a409-bb3261d8f781.png)
8. In the Security Lists section click the Default Security List… link
![image6](https://user-images.githubusercontent.com/27055614/182983395-c991459f-e484-4b43-a84e-0b9298de04d4.png)
9. Click Add Ingress Rules button
10. Fill out the Ingress Rule form:
* Stateless: Unchecked
* Source Type: CIDR
* Source CIDR: 0.0.0.0/0
* IP Protocol: TCP
* Source Port Range: [blank]
* Destination Port Range: 2283
* Description: Immich
11. Click Add Ingress Rules button
![image10](https://user-images.githubusercontent.com/27055614/182983445-3022bfb7-5901-4137-97f6-e7c580d87d18.png)
12. Click hamburger menu > Compute > Instance
![image16](https://user-images.githubusercontent.com/27055614/182982523-ae8f4767-f194-4a96-872b-d095cac0cc98.png)
![image1](https://user-images.githubusercontent.com/27055614/182982584-94fa4482-66cb-447b-b7e9-f750581ccc2c.png)
13. Select instance
![image22](https://user-images.githubusercontent.com/27055614/182983642-da076756-4665-4395-9675-3504a1b111cc.png)
14. Click the Copy link beside "Public IP Address"
![image4](https://user-images.githubusercontent.com/27055614/182983663-6d827fe7-e1c6-4fc7-b466-50963a3e5077.png)
15. Open PuTTY
![image11](https://user-images.githubusercontent.com/27055614/182983686-f3bbed87-cdde-4761-85f4-1bcdd0515668.png)
16. Paste Public IP Address into Host Name text box
![image18](https://user-images.githubusercontent.com/27055614/182983708-0fb0256b-0506-4bef-a4f4-8ce88c29b3c9.png)
17. On left-hand side of PuTTY window expand SSH menu and click Auth
![image29](https://user-images.githubusercontent.com/27055614/182983750-79c8d5e2-05f4-47ef-90e8-69ce5e1e130f.png)
18. Click Browse button, browse to the location that you saved your private key file in PuTTYGen and click the open button
![image17](https://user-images.githubusercontent.com/27055614/182983775-88f4400a-910d-496d-a724-40850afb2d93.png)
19. On left hand side of PuTTY window select Session, enter any name youd like in to Saved Sessions text box and click Save button
![image24](https://user-images.githubusercontent.com/27055614/182983789-6cd0ff82-0533-419f-b89b-9e7b4a99cb40.png)
20. Double click the new session and click Accept on the PuTTY Security Alert prompt
![image20](https://user-images.githubusercontent.com/27055614/182983801-a82caa77-e3de-471a-9ab5-f6463f2d039f.png)
21. log in as: ubuntu
![image19](https://user-images.githubusercontent.com/27055614/182983825-438b5788-fc7e-4ca9-98f0-b725a6cbe112.png)
22. Enter the following commands in the order listed. You must enter them 1 at a time. You can copy (highlight > right-click Copy) from this document and paste it into the PuTTY window (right-click). If at any point you are prompted with a bright pink Package configuration screen, push tab-enter to select Ok and continue with the following steps.
```bash
sudo -i
apt update
apt upgrade -y
apt install net-tools ca-certificates curl gnupg lsb-release
mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
mkdir immich-main
mkdir immich-photos
cd immich-main
wget https://raw.githubusercontent.com/immich-app/immich/main/docker/docker-compose.yml
wget https://raw.githubusercontent.com/immich-app/immich/main/docker/.env.example
cp .env.example .env
nano .env
```
*Use arrow keys to navigate down to Upload File Config section and set UPLOAD_LOCATION to /root/immich-photos
*Navigate to JWT SECRET section and set JWT_SECRET to some random string of characters (see image below for example
![image5](https://user-images.githubusercontent.com/27055614/182983897-02a55d7e-9e1c-4bd9-85e7-f845471a865c.png)
* Navigate to WEB - Required section
* Open another PuTTY window, click on your saved session and click Load button. Take note of the IP address in the Host Name text box.
![image7](https://user-images.githubusercontent.com/27055614/182983909-2bbfd2b0-5b35-4397-8a24-1a6b78eec994.png)
* Set VITE_SERVER_ENDPOINT to http://<ip address>:2283/api (see pic for example)
![image26](https://user-images.githubusercontent.com/27055614/182983925-30b6aee7-3a8c-4634-9a51-d2edfab82e5c.png)
* Press CTRL-X and then Y and then Enter to save
* Enter command: docker compose up -d
* Wait at least 2 minutes
* Close PuTTY
* Open Windows Browser and navigate to: http://<ip address>:2283
* Done! If you enjoy Immich please consider buying Alex a coffee :)
[https://www.buymeacoffee.com/altran1502](https://www.google.com/url?q=https://www.buymeacoffee.com/altran1502&sa=D&source=editors&ust=1659666519556192&usg=AOvVaw0TDie7KOtkBgzMIoCrAHDU)