Simple script for performing initial setup on my homelab server. The tasks include package updates, workspace directory configuration, timezone setting, creation of a default user, installation of git, zip, unzip, curl, acl, docker, adding GitHub, GitLab, and Bitbucket to trusted hosts, and configuring CapRover to transform the server into a user-friendly PaaS for hosting my services, complete with SSL configuration, reverse proxy, and other conveniences.
Tested on a VPS running Ubuntu Server 22.04 LTS with 4GB RAM, but can be used in similar distributions.
To do the setup, download and run the script install.sh
or if you prefer (proceed at your own risk), execute the instruction below.
curl -sSL https://fabioassuncao.com/gh/homelab-setup/install.sh | bash -s -- \
--help
You can get help by passing the -h
option.
Script for initial configurations of Docker, Docker Swarm and CapRover.
USAGE:
curl -sSL https://fabioassuncao.com/gh/homelab-setup/install.sh | bash -s -- [OPTIONS]
OPTIONS:
-h|--help Print help
-t|--timezone Standard system timezone
--root-password New root user password. The script forces the password update
--default-user Alternative user (with super powers) that will be used for deploys and remote access later
--default-user-password
--workdir Folder where all files of this setup will be stored
--spaces Subfolders where applications will be allocated (eg. apps, backups)
--root-ssh-passphrase Provides a passphrase for the ssh key
--ssh-passphrase Provides a passphrase for the ssh key
--ip-address Main node IP address
--local It determines whether it is a local installation or online, such as a VPS
-f|--force Force install/re-install
OPTIONS (Webhook):
--webhook-url Ping URL with provisioning updates
In order for you to be able to deploy applications using git and some deployment tools such as the deployer, you will need to add the public key (id_rsa.pub) of the user created on your VCS server (bitbucket, gitlab, github, etc.).
To not have to enter the password every time you need to access the remote server by SSH or have to do some deploy, type the command below. This will add your public key to the new user's authorized_keys
file.
ssh-copy-id <USERNAME>@<SERVER IP>
- Fork this repository!
- Create your feature from the develop branch: git checkout -b feature/my-new-feature
- Write and comment your code
- Commit your changes:
git commit -am 'Add some feature'
- Push the branch:
git push origin feature/my-new-feature
- Make a pull request to the branch develop
Licensed under the MIT License.