Files
scripts_mg/server_scripts/ReadME.md
Marco Gallegos a8e198645b Create ReadME.md
2025-04-28 19:40:56 -06:00

84 lines
2.7 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 🚀 Auto Server Setup — Ubuntu 22.04 / 24.04 LTS
## ⚡ Instalación rápida
Copia y pega en tu terminal (sesión **root** o con `sudo`):
```bash
curl -fsSL https://raw.githubusercontent.com/marcogll/scripts_mg/main/server_scripts/auto_server_setup.sh \
-o auto_server_setup.sh && chmod +x auto_server_setup.sh && sudo ./auto_server_setup.sh
```
---
## 📦 ¿Qué instala?
| Bloque | Paquetes / Servicios |
| ------ | ------------------- |
| **Base** | `git` `curl` `nano` `gnupg` `ca-certificates` … |
| **Shell** | **Zsh**, OhMyZsh, `zshautosuggestions` |
| **Utils** | `fzf`, `btop` |
| **SSL** | **Certbot** (Lets Encrypt, vía **snap**) |
| **Docker** | Docker Engine + composeplugin (repo oficial) |
| **Red** | **ZeroTier One** (VPN P2P) |
| **UI** | **Portainer CE** (contenedor) |
| **Apps** | **CasaOS** *(opcional)*, **Pihole** *(opcional, nativo)*, **Plex Media Server* |
---
## 🧩 Lógica del orden
1. **Base APT**  actualiza el sistema y añade utilidades básicas.
2. **Shell + Utils**  mejora la experiencia de terminal antes de tareas largas.
3. **Certbot**  ocupa el puerto 80 para los retos HTTP01; se instala temprano.
4. **Docker**  prerequisito de Portainer y CasaOS.
5. **ZeroTier**  habilita acceso remoto P2P seguro.
6. **Portainer**  despliegue de UI Docker (contenedor).
7. **CasaOS** *(opcional)*  dashboard doméstico que detecta Docker.
8. **Pihole** *(opcional)*  DNS sinkhole nativo.
9. **Plex**  servicio systemd desde repo oficial.
10. **Reinicio**  automático si `AUTO_REBOOT=yes`.
---
## 🔧 Variables rápidas dentro del script
```bash
SERVER_USER="marco" # usuario añadido a los grupos docker/zerotier
INSTALL_PIHOLE="yes" # "no" para omitir Pi-hole
INSTALL_CASAOS="yes" # "no" para omitir CasaOS
AUTO_REBOOT="yes" # "no" para reiniciar manualmente
```
---
## 🎯 Accesos postinstalación
| Servicio | URL por defecto |
| -------- | --------------- |
| Portainer | `https://<IP-servidor>:9443` |
| CasaOS | `http://<IP-servidor>` *(si lo instalaste)* |
| Plex | `http://<IP-servidor>:32400/web` |
| Pihole | `http://<IP-servidor>/admin` *(si lo instalaste)* |
---
## 🛡️ Notas de seguridad
* **Certbot** se instala vía *snap*; emite tus certificados así:
```bash
sudo certbot certonly --standalone -d ejemplo.com -m tu@email.com
```
* **ZeroTier** no une automáticamente tu servidor a ninguna red. Hazlo con:
```bash
sudo zerotier-cli join <NETWORK_ID>
```
* El script importa claves GPG y repos oficiales para cada componente.
---
## 📄 Licencia
MIT — puedes usar, modificar y redistribuir libremente este script.