---
# System prepended metadata

title: Configure Ubuntu

---

# Configure Ubuntu

```shell
# ==================
#    install ruby
# ==================
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
exec $SHELL -l
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install 2.6.5
rbenv rehash
rbenv global 2.6.5

# ====================
#    Install docker
# ====================
sudo apt update
sudo apt install -y \
     apt-transport-https \
     ca-certificates \
     curl \
     software-properties-common
# Add to apt repository
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
     "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
     $(lsb_release -cs) \
     stable"
sudo apt update
# Install docker and configure
sudo apt install -y docker-ce
sudo gpasswd -a yamalabo docker
sudo chmod 666 /var/run/docker.sock
# Install docker-compose
export compose='1.24.1'
sudo curl -L https://github.com/docker/compose/releases/download/${compose}/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod 0755 /usr/local/bin/docker-compose

# ====================
#     Configure FW
# ====================
sudo ufw enable
sudo ufw allow 22
sudo ufw allow 80
sudo ufw allow 443
sudo ufw allow 5000  # Datadog
sudo ufw allow 5001  # Datadog
sudo ufw allow 8125  # Datadog
sudo ufw allow 18332 # Bitcoin
sudo ufw allow 18333 # Bitcoin
sudo ufw allow 8332  # Bitcoin
sudo ufw allow 8333  # Bitcoin
sudo ufw allow 6000  # LND, Ptarmigan ifpaytt
sudo ufw allow 9735  # LND, Ptarmigan
sudo ufw allow 4001  # IPFS Gateway
sudo ufw allow 8080  # IPFS Gateway
```

deb http://jp.archive.ubuntu.com/ports/ bionic main restricted universe multiverse
#deb-src http://jp.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse

deb http://jp.archive.ubuntu.com/ports/ bionic-security main restricted universe multiverse
#deb-src http://jp.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://jp.archive.ubuntu.com/ports/ bionic-updates restricted main multiverse universe
#deb-src http://jp.archive.ubuntu.com/ubuntu/ bionic-updates restricted main multiverse universe

deb http://jp.archive.ubuntu.com/ports/ bionic-backports restricted main multiverse universe
#deb-src http://jp.archive.ubuntu.com/ubuntu/ bionic-backports restricted main multiverse universe

/etc/apt/sources.list