138 lines
4.5 KiB
Markdown
138 lines
4.5 KiB
Markdown
---
|
|
created: 2026-08-06T14:36:00
|
|
tags:
|
|
- thestateofshit
|
|
- reference
|
|
updated: 2026-08-06T14:46:00
|
|
---
|
|
|
|
# **Ubuntu VPS & AWS Configuration Reference Guide**
|
|
|
|
# server
|
|
export AWS_BEARER_TOKEN_BEDROCK=ABSKQmVkcm9ja0FQSUtleS03OG9pLWF0LTgxODU2NjgyOTQzNjpmWVZnSkUweDFMaHBFdkw3ZXJzV08xaEl6R1UyOEdYY3pidXU2bGpGTkNWcS9DYytpOVhZa21RVFpoWT0=
|
|
|
|
instancenamei-082dd7b58310155c4
|
|
Host dashit
|
|
HostName 3.23.239.121
|
|
User ubuntu
|
|
IdentityFile ~/.ssh/dashit.pem
|
|
ServerAliveInterval 60
|
|
|
|
|
|
|
|
|
|
|
|
This document serves as your complete operational checklist and command reference for setting up, securing, and managing your Ubuntu ARM64 VPS paired with AWS tools.
|
|
|
|
## **1\. System Baseline & Core Utilities**
|
|
|
|
Always start by ensuring your system packages are completely up to date and equipped with essential administration utilities.
|
|
|
|
### **System Updates**
|
|
|
|
sudo apt update && sudo apt upgrade \-y
|
|
|
|
### **Essential Utilities Installation**
|
|
|
|
sudo apt install \-y curl git ufw htop ncdu unzip
|
|
|
|
* **curl**: Downloads files from the web, tests APIs, and pulls install scripts.
|
|
* **git**: Clones and synchronizes code repositories.
|
|
* **ufw**: Configures your firewall to block unauthorized inbound connections.
|
|
* **htop**: Interactive, color-coded CPU and RAM process monitor.
|
|
* **ncdu**: Terminal disk space analyzer to visually track and clean up large files.
|
|
* **unzip**: Extracts .zip installation packages and configuration archives.
|
|
|
|
### **Architecture Verification**
|
|
|
|
Always confirm your server chip architecture before downloading pre-compiled binaries:
|
|
|
|
uname \-m
|
|
|
|
* *Note:* If it outputs aarch64 or arm64, always pull ARM64/AArch64 binaries. Avoid x86\_64/amd64 builds to prevent Exec format error.
|
|
|
|
## **2\. Firewall Lockdown (UFW)**
|
|
|
|
Secure your server immediately before exposing it to the public internet.
|
|
|
|
\# Set strict default rules
|
|
sudo ufw default deny incoming
|
|
sudo ufw default allow outgoing
|
|
|
|
\# Allow necessary traffic ports
|
|
sudo ufw allow ssh
|
|
sudo ufw allow http
|
|
sudo ufw allow https
|
|
|
|
\# Enable the firewall
|
|
sudo ufw enable
|
|
|
|
## **3\. Docker & Docker Compose Engine**
|
|
|
|
Docker runs applications safely inside isolated containers, protecting your host operating system.
|
|
|
|
### **Installation via Official Repository**
|
|
|
|
\# 1\. Add Docker's official GPG key:
|
|
sudo apt-get install \-y ca-certificates curl
|
|
sudo install \-m 0755 \-d /etc/apt/keyrings
|
|
sudo curl \-fsSL https://download.docker.com/linux/ubuntu/gpg \-o /etc/apt/keyrings/docker.asc
|
|
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
|
|
|
\# 2\. Add repository to Apt sources:
|
|
echo \\
|
|
"deb \[arch=$(dpkg \--print-architecture) signed-by=/etc/apt/keyrings/docker.asc\] https://download.docker.com/linux/ubuntu \\
|
|
$(. /etc/os-release && echo "$VERSION\_CODENAME") stable" | \\
|
|
sudo tee /etc/apt/sources.list.d/docker.list \> /dev/null
|
|
|
|
sudo apt-get update
|
|
|
|
\# 3\. Install Docker Engine and Compose plugin:
|
|
sudo apt-get install \-y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
|
|
|
\# 4\. Allow your user to run Docker commands without 'sudo':
|
|
sudo usermod \-aG docker $USER
|
|
|
|
> *Important:* After running the last command, log out of your SSH session and log back in for group changes to take effect.
|
|
|
|
### **Daily Docker Quick Commands**
|
|
|
|
* **Test installation:** docker run hello-world
|
|
* **Clean up test container:** docker rm $(docker ps \-a \-q \-f ancestor=hello-world)
|
|
* **Delete test image:** docker rmi hello-world
|
|
* **List active containers:** docker ps
|
|
* **List all containers (including stopped):** docker ps \-a
|
|
* **List downloaded images:** docker images
|
|
|
|
## **4\. AWS CLI (v2) Setup for ARM64**
|
|
|
|
Because your VPS operates on an ARM64 processor, you must explicitly fetch the ARM-compatible binary bundle.
|
|
|
|
### **Installation Procedure**
|
|
|
|
\# Download the ARM64/AArch64 package
|
|
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" \-o "awscliv2.zip"
|
|
|
|
\# Unzip and install system-wide
|
|
unzip awscliv2.zip
|
|
sudo ./aws/install
|
|
|
|
\# Clean up installer files
|
|
rm \-rf awscliv2.zip aws
|
|
|
|
### **Verification**
|
|
|
|
aws \--version
|
|
|
|
### **Configuration & Testing**
|
|
|
|
\# Run configuration wizard (Input your region, e.g., us-east-2)
|
|
aws configure
|
|
|
|
\# Test API connectivity and verify authentication
|
|
aws sts get-caller-identity
|
|
|
|
## **5\. Development Workspace Guidelines**
|
|
|
|
* **Python Environments:** Always run python projects inside virtual environments (python3 \-m venv venv && source venv/bin/activate). Avoid sudo pip install.
|
|
* **Manual Binaries:** Always check download targets for arm64 or aarch64 tags. |