No description
  • Shell 99.3%
  • JavaScript 0.7%
Find a file
2026-04-24 13:37:11 +02:00
.husky feat: install gitea 2023-05-15 11:29:45 +02:00
.vscode feat: update markdownlint settings 2024-01-21 19:03:57 +01:00
scripts fix: add ufw if not existing 2026-04-24 13:37:11 +02:00
tools build: add shellcheck script 2023-05-23 16:41:16 +02:00
.editorconfig Initial commit 2020-08-22 13:24:11 +02:00
.gitignore Initial commit 2020-08-22 13:24:11 +02:00
.markdownlint.json Initial commit 2020-08-22 13:24:11 +02:00
.markdownlintignore chore(deps): update deps 2023-05-15 11:29:45 +02:00
.shellcheckrc Initial commit 2020-08-22 13:24:11 +02:00
package-lock.json deps: update patch versions 2023-09-11 21:03:28 +02:00
package.json deps: update patch versions 2023-09-11 21:03:28 +02:00
README.md doc(README): change repository url 2026-04-24 13:20:54 +02:00

Server setup instructions

Table of contents

Prerequisites

Point your domain names to your machine IP address

Back to top ↑

Before continuing, your machine needs to have a dedicated domain name that will be its hostname.

You also need to point your app domain names to your machine IP address if you want to host an app for them. See with your domain name registrar to set up A (IPV4) or AAAA (IPV6) records to perform this operation.

A minimal DNS zone typically looks like this:

minimal-dns-zone

For example, after that, you will be able to login with:

ssh johndoe@mymachine.example.com

Instead of:

ssh johndoe@50.70.150.30

Configure an SSH key

Back to top ↑

Before going any further, you need to generate an SSH key.

ssh-keygen -t ed25519 -N '' -f ~/.ssh/id_ed25519

Then add it to your server by using:

hostname=mymachine.example.com
userName="johndoe"
ssh "${userName}"@"${hostname}" "echo '$(cat ~/.ssh/id_ed25519.pub)' | tee -a ~/.ssh/authorized_keys > /dev/null"

You can also add it to the root account:

ssh -t "${userName}"@"${hostname}" "echo '$(cat ~/.ssh/id_ed25519.pub)' | sudo tee -a /root/.ssh/authorized_keys > /dev/null"

Create a user account with sudo privileges

Back to top ↑

By default, Ubuntu comes preinstalled with a non-root sudo user named "ubuntu". The "root" user exists but is not accessible. This is how you are supposed to use your machine, because part of the power inherent with the root account is the ability to make very destructive changes, even by accident.

But you will probably want something more meaningful than "ubuntu" as a username, so you can rename it by using the "root" account (because you can't rename the user you currently logged in).

# Login to your machine's root account
ssh root@"${hostname}"

userName="johndoe"

# Rename user
usermod -l "${userName}" ubuntu

# Rename user group
groupmod -n "${userName}" ubuntu

# Rename home directory
usermod -d /home/"${userName}" -m "${userName}"

# Change password
passwd "${userName}"

# Disconnect from your machine
exit

After that, you will be able to login with:

ssh johndoe@mymachine.example.com

Installation

Back to top ↑

Clone this repository:

git clone https://git.fallet.net/romain.fallet/server-setup ~/.server-setup

Run install script:

bash ~/.server-setup/scripts/install.sh

Reload your .bashrc to make aliases available:

. ~/.bashrc

Update

Back to top ↑

ss:self-update

Recipes

Web machine

Back to top ↑

ss:recipes:web-machine

Mail machine

Back to top ↑

ss:recipes:mail-machine

Application machine

Back to top ↑

ss:recipes:application-machine

CI machine

Back to top ↑

ss:recipes:ci-machine

CI runner machine

Back to top ↑

ss:recipes:ci-runner-machine

File machine

Back to top ↑

ss:recipes:file-machine

Daily backup machine

Back to top ↑

ss:recipes:daily-backup-machine

Contributing

Development installation

Back to top ↑

Clone this repository:

git clone https://github.com/RomainFallet/server-setup

Install dependencies:

npm ci

Project commands

Back to top ↑

Lint markdown and bash files:

npm run lint

Format markdown files!

npm run format

Check dependencies vulnerabilities:

npm audit

Install latest dependencies patches:

npm update