talks/homeserver.md

384 lines
6.6 KiB
Markdown
Raw Normal View History

2019-04-03 15:06:59 +00:00
---
inlineSVG: true
---
# <!--fit--><!-- _class: lead -->The Home Server Talk
\- _nemo_
---
2019-06-10 12:28:18 +00:00
# `whoami`
2019-04-03 15:06:59 +00:00
- Nemo
- [@captn3m0](https://twitter.com/captn3m0)
- [@razorpay](https://razorpay.com) (:money_with_wings: :credit_card:)
---
# agenda
2019-06-10 12:28:18 +00:00
0. what counts as a homeserver?
1. Why you should run one?
1. How do you get started?
1. All the gotchas!
1. CTA
---
# homeserver
A _computer_ which runs service(s) for personal use.
---
![bg](https://fakeimg.pl/1920x800/C4E538/fff/?text=why?)
---
# motivation?
1. owning your data
---
# motivation?
1. owning your data
2. de-googling
---
# motivation?
1. owning your data
2. de-googling
3. backing up your data locally
---
# motivation?
1. owning your data
2. de-googling
3. backing up your data locally
4. learning/experimenting with tech
2019-04-03 15:06:59 +00:00
---
# motivation?
1. owning your data
2. de-googling
3. backing up your data locally
4. learning/experimenting with tech
5. playing mario
---
2019-06-10 12:28:18 +00:00
# <!-- _class: lead --> ![drop-shadow](./images/sideproject.jpg)
---
2019-04-03 15:06:59 +00:00
# time?
_<5 hr a month_
---
2019-06-10 12:28:18 +00:00
![bg](https://fakeimg.pl/1920x800/C4E538/fff/?text=software)
![bg vertical](https://fakeimg.pl/1920x800/A3CB38/fff/?text=hardware)
![bg](https://fakeimg.pl/1920x800/009432/fff/?text=glue)
2019-04-03 15:06:59 +00:00
---
2019-06-10 12:28:18 +00:00
![bg](images/elite130.jpg)
---
![bg](images/htpc.jpg)
---
# what I run
## Monitoring
- Prometheus
- Grafana
- speedtest-exporter
- ACT Exporter
- CAdvisor
---
![bg fit](images/act2.jpg)
---
## Media
- Airsonic (:musical_note:) (Google Play)
- Jellyfin (:movie_camera:) (Netflix)
- Kodi (:tv:) (Home Theater)
- Audioserve (:studio_microphone: :book:) (Audible)
---
## Content
- NextCloud :cloud: :white_check_mark: (Google Drive/iCloud)
- Miniflux (:newspaper_roll: `RSS`) (Google Reader)
- Timemachine (💻 ⏮)
- wiki.js
- Radicale :date: :card_index_dividers: (Google Contacts/Google Calendar)
- RSS Bridge
- Resilio :arrows_counterclockwise: (Dropbox)
- Gitea (GitHub)
---
![bg](https://fakeimg.pl/1920x800/C4E538/fff/?text=hardware)
---
## [Specs](https://in.pcpartpicker.com/list/fZfp6s)
- Intel i5-7600 3.5GHz
- Nvidia 1050 Ti 4GB
- 2x8GB DDR4 RAM
- 3x3TB Internal HDD
- MSI B250I Motherboard
## :cloud:
- DO 1vCPU / 2GB RAM / 30GB SSD ($10/mo) (BLR1 region)
- \+ 100GB disk
---
# A VM on the :cloud:
- Scaleway: 4ARMv8/2GB/50GB - 300 INR
- AWS Lightsail: 1vCPU/512MB/20GB - 250 INR
- Digital Ocean: 1vCPU/1GB/25GB - 350 INR
_Beware of Persistent Storage cost_
---
# :cloud:
- Security: Footgun
- Batteries included
- OpEx
---
# cloud storage
| Storage | Cost/month | Retail |
| :------ | ---------- | ------ |
| 1TB-SSD | $100 | $99 |
| 3TB-SSD | $300 | $224 |
| 1TB | $25 | $45 |
| 3TB | $75 | $84 |
2019-04-03 15:06:59 +00:00
---
# Raspberry Pi 3
- :memo: 1GB RAM
- :globe_with_meridians: Wireless/BLE/Ethernet
- :chains: 4 USB ports
- :musical_note: Audio/HDMI/Composite VGA
- :zap: 2.5A
- :money_with_wings: ~3k INR
- :camera:, GPIO
![bg right](https://cdn.shopify.com/s/files/1/0176/3274/products/Kit-game_1024x1024.jpg)
---
2019-06-10 12:28:18 +00:00
# system76 Meerkat
2019-04-03 15:06:59 +00:00
2019-06-10 12:28:18 +00:00
![bg](https://d1vhcvzji58n1j.cloudfront.net/assets/products/meer4/hero_wide-7cf0ee6536_2560.jpg)
2019-04-03 15:06:59 +00:00
2019-06-10 12:28:18 +00:00
<!-- TODO: Fix header -->
2019-04-03 15:06:59 +00:00
---
# Other Alternatives
![bg right](http://www.thebookpc.com/v/vspfiles/photos/RV-NUC-I3-LINUX-2.jpg)
1. Intel NUCs
2. [Hetzner Server Auctions](https://www.hetzner.com/sb) (20-50USD/mo).
3. NAS/Network device.
4. Gamer? [`r/pcmasterrace/wiki`](https://www.reddit.com/r/pcmasterrace/wiki/builds)
<!-- _TODO: better image_ -->
---
2019-06-10 12:28:18 +00:00
# have some old laptops?
2019-04-03 15:06:59 +00:00
2019-06-10 12:28:18 +00:00
<!-- https://preview.redd.it/b9fvg5yo5dl21.jpg?width=1024&auto=webp&s=9a5a4d9fdd4e486a23c159f4e4e27e88942018f5 -->
2019-04-03 15:06:59 +00:00
2019-06-10 12:28:18 +00:00
![bg cover](images/homelab1.jpg)
---
# really into networking?
<!-- https://preview.redd.it/8682wq9m8kn21.jpg?width=576&auto=webp&s=41e7ab264fcbb054209981126259b9b44b9d1d70 -->
![bg cover](images/homelab2.jpg)
---
# really want a cluster?
<!-- http://raspberrywebserver.com/raspberrypicluster/raspberry-pi-cluster.html -->
![bg cover](images/cluster.jpg)
---
# Hybrid
- Local Disk, Cloud Compute
![](images/hybrid.jpg)
2019-04-03 15:06:59 +00:00
---
2019-06-10 12:28:18 +00:00
| | Cloud | Pi | PC\* | Hybrid | NAS |
| :------------------ | ------------------ | --- | -------- | ------ | --- |
| **Security** :lock: | + | ++ | ++ | + | ++ |
| **Utility** | +++ | - | :dollar: | ++ | - |
| **Cost** | :money_with_wings: | +++ | ++ | + | ++ |
| **Setup-Ease** | + | + | - | -- | ++ |
| **Ops-Ease** | ++ | - | + | - | ++ |
| **Storage** | -- | - | + | ++ | ++ |
| **Gaming** | -- | - | ++ | ++ | -- |
| **HTPC** | :dollar: | + | ++ | ++ | + |
2019-04-03 15:06:59 +00:00
2019-06-10 12:28:18 +00:00
- \*Includes DIY/PC/Alienware/Old Laptops/Gaming PC
---
![bg](https://fakeimg.pl/1920x800/C4E538/fff/?text=glue)
2019-04-03 15:06:59 +00:00
---
# software
1. docker
2. kubernetes
3. ansible/puppet/chef
4. [tool-of-your-choice](https://docs.google.com/spreadsheets/d/1FCgqz1Ci7_VCz_wdh8vBitZ3giBtac_H8SBw4uxnrsE/edit#gid=0)
---
# software
1. docker **\***
2. kubernetes
3. ansible/puppet/chef
4. helm?
---
# containers?
- secure
- declarative configuration
- orchestration is 100x easier
---
# networking
- Public+Static IP Address
- Floating/Elastic IP
---
![bg cover](images/networking.jpg)
---
# configuration
- terraform + docker
- kubernetes + helm
- ansible + galaxy
- docker-compose
---
# terraform
```json
module "requestbin" {
name = "requestbin"
source = "./modules/container"
image = "jankysolutions/requestbin:latest"
web {
expose = true
port = "8000"
host = "requestbin.bb8.fun"
}
networks = "${list(module.docker.traefik-network-id)}"
}
```
2019-06-10 12:28:18 +00:00
- source: <https://git.captnemo.in/nemo/nebula>
- [terraform.io/docker](https://www.terraform.io/docs/providers/docker/)
2019-04-03 15:06:59 +00:00
---
# Docker API
1. Manage networks,
2. Containers,
3. Configuration
All over a API, but only for one host.
2019-06-10 12:28:18 +00:00
docker swarm, but single host
---
# security
1. Don't expose services
2. Expose services without auth over VPN only
3. Don't expose management services over Internet
4. Keep services behind Auth (even Basic Auth works)
5. Go Hybrid
2019-04-03 15:06:59 +00:00
---
# self-hosting references
- [kickball/awesome-selfhosted](https://github.com/Kickball/awesome-selfhosted)
- [linuxserver.io](https://www.linuxserver.io/)
- [r/selfhosted](https://reddit.com/r/selfhosted)
<!-- paginate: true -->
<style>
section.lead h1 {
text-align: center;
}
</style>
2019-06-10 12:28:18 +00:00
---
# questions?
- [me@captnemo.in](mailto:me@captnemo.in)
- [@captn3m0](https://twitter.com/captn3m0)