mirror of
https://github.com/tomasriveral/vps-config.git
synced 2026-08-11 18:18:38 +02:00
rewrote init and readme into bootstrap
This commit is contained in:
@@ -15,7 +15,7 @@ The server uses:
|
||||
|
||||
---
|
||||
|
||||
# 1. Create the VPS
|
||||
# 1. Setup the VPS
|
||||
|
||||
Recommended:
|
||||
|
||||
@@ -26,112 +26,15 @@ Recommended:
|
||||
|
||||
After creation:
|
||||
|
||||
```bash
|
||||
ssh root@SERVER_IP
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
# 2. Bootstrap the server
|
||||
|
||||
Copy the bootstrap script to the server:
|
||||
|
||||
```bash
|
||||
scp bootstrap.sh root@SERVER_IP:
|
||||
```
|
||||
|
||||
Connect:
|
||||
|
||||
```bash
|
||||
ssh root@SERVER_IP
|
||||
```
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
chmod +x bootstrap.sh
|
||||
read IP_ADDRESS
|
||||
scp bootstrap.sh root@$IP_ADDRESS:
|
||||
ssh root@$IP_ADDRESS
|
||||
./bootstrap.sh
|
||||
```
|
||||
|
||||
This installs:
|
||||
|
||||
* Docker CE
|
||||
* Docker Compose
|
||||
* Git
|
||||
* Basic administration tools
|
||||
* Firewall rules
|
||||
|
||||
Verify:
|
||||
|
||||
```bash
|
||||
docker --version
|
||||
docker compose version
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
# 3. Create an administrator user
|
||||
|
||||
Do not run everything as root.
|
||||
|
||||
Create a user:
|
||||
|
||||
```bash
|
||||
adduser USERNAME
|
||||
```
|
||||
|
||||
Add permissions:
|
||||
|
||||
```bash
|
||||
usermod -aG sudo,docker USERNAME
|
||||
```
|
||||
|
||||
Copy SSH keys:
|
||||
|
||||
```bash
|
||||
mkdir -p /home/USERNAME/.ssh
|
||||
cp /root/.ssh/authorized_keys /home/USERNAME/.ssh/
|
||||
chown -R USERNAME:USERNAME /home/USERNAME/.ssh
|
||||
chmod 700 /home/USERNAME/.ssh
|
||||
chmod 600 /home/USERNAME/.ssh/authorized_keys
|
||||
```
|
||||
|
||||
Test:
|
||||
|
||||
```bash
|
||||
ssh USERNAME@SERVER_IP
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
# 4. Clone the server configuration
|
||||
Clone the configuration repository:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/tomasriveral/vps-config
|
||||
cd vps-config
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
# 5. Configure secrets
|
||||
|
||||
Never store passwords or tokens in Git.
|
||||
|
||||
Create:
|
||||
|
||||
```bash
|
||||
nano .env
|
||||
```
|
||||
|
||||
See `.env.example`
|
||||
|
||||
# 6. Init the system
|
||||
```
|
||||
./scripts/init.sh
|
||||
```
|
||||
|
||||
# 7. Deploy
|
||||
# 2. Deploy
|
||||
```
|
||||
./scripts/deploy.sh
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user