Shell Scripts to Setup my Home Server.
https://chse.dev/hs
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
--> Linted: EDITORCONFIG No errors were found in the linting process
Details
--> Linted: GITLEAKS No errors were found in the linting process
Details
--> Linted: YAML No errors were found in the linting process
Details
lint
Details
|
4 days ago | |
---|---|---|
.github | 2 weeks ago | |
.vscode | 2 months ago | |
src | 4 days ago | |
.editorconfig | 2 months ago | |
.gitattributes | 2 months ago | |
.gitignore | 2 months ago | |
LICENSE.md | 2 months ago | |
README.md | 4 weeks ago | |
renovate.json | 2 months ago |
README.md
Shell Scripts to Setup my Home Server.
# if reinstalling, backup data first.
# Install Ubuntu Server, Import SSH Keys
# Login with user created during install
sudo su -
cd ~
git clone https://git.chse.dev/chase/infrastructure.git
cd infrastructure/src
# setup secrets in ./resources/secrets & ./resources/ssh-keys
# if setting up the main/game server, setup docker-compose.yml secrets
# if setting up the main server, do manual steps 1-2 before running the script
bash $device.sh
cd ~
rm -rf infrastructure/
Read More: The Ever-Expanding Home Server - Everything I self-host, in one convenient spot.
Details:
Click to expand
- Every Server:
- Installs Basic Packages
- Locks Down SSH (& Installs My Keys)
- Installs My Scripts, Dotfiles, ZSH Plugins
- Starts fail2ban
- Disables Default MOTD & Installs Mine
- sysctl Tweaks
- Unattended Upgrades
- Main Server:
- Changes SSH Port
- Installs Docker, Plex
- Sets up Secrets
- Adds cronjobs
- Spins up all my Docker Containers
- Game Server:
- Changes SSH Port
- Installs Docker
- Spins up all my Docker Containers
- Mail-in-a-Box:
- Symlink Mail Scripts to ~
- Adds cronjob for Backup
Main Server Manual Steps
Click to expand
1. Mount Drives
lsblk
# Find Drive(s) to mount
blkid | grep "/dev/driveHere" # Look for "UUID="
nano /etc/fstab # Add "UUID=uuidHereFromBefore /media/easystore ext4 defaults 0 0" to the end of the file
mkdir /media/easystore # Repeat for other drives
mount -a
2. Folder Permissions
- Open docker-compose.yml
- Search for
PGID
chown -R user:media /dockerData/containerName
(or other applicable place)
3. Deploy Nextcloud
# Backup Nextcloud Data
rm -rf /media/easystore/nc_backup_files
mkdir /media/easystore/nc_backup_files
mv /media/easystore/Nextcloud/admin/files/* /media/easystore/nc_backup_files/
rm -rf /media/easystore/Nextcloud # Clean out existing Nextcloud (for reinstall)
sudo docker run -d \
--init \
--sig-proxy=false \
--name nextcloud-aio-mastercontainer \
--restart always \
--publish 11001:8080 \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
-e APACHE_PORT=11000 \
-e DISABLE_BACKUP_SECTION=true \
-e NEXTCLOUD_ADDITIONAL_APKS=imagemagick \
-e NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS=imagick \
-e NEXTCLOUD_ENABLE_DRI_DEVICE=true \
-e NEXTCLOUD_DATADIR=/media/easystore/Nextcloud \
nextcloud/all-in-one:latest
- Open Nextcloud AIO
- Copy down password
- Login
- Disable Talk
- Set Timezone
- Start Containers
- Use Nextcloud Web UI to delete all the default files
# Restore Nextcloud Data
mv /media/easystore/nc_backup_files/* /media/easystore/Nextcloud/admin/files/
chown -R www-data:www-data /media/easystore/Nextcloud/admin/files/
sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files:scan --all
rm -rf /media/easystore/nc_backup_files