Last active
May 11, 2024 18:40
-
-
Save wittawasw/78f761e969330da6d9b9be202d9d894b to your computer and use it in GitHub Desktop.
Ruby 3.1 server provisioning Ubuntu 20.04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt update | |
apt upgrade -y | |
apt install -y apt-transport-https ca-certificates curl gnupg build-essential libjemalloc-dev git zlib1g-dev libssl-dev libreadline-dev libffi-dev locales libsqlite3-dev libyaml-dev libncurses5-dev libgmp-dev libgdbm6 libgdbm-dev tzdata gcc g++ make libpq-dev net-tools ubuntu-dev-tools | |
# jemalloc dependency | |
echo "deb http://security.ubuntu.com/ubuntu impish-security main" | sudo tee /etc/apt/sources.list.d/impish-security.list | |
apt update | |
apt install libssl1.1 | |
touch /etc/apt/sources.list.d/fullstaq-ruby.list | |
echo "deb https://apt.fullstaqruby.org ubuntu-20.04 main" >> /etc/apt/sources.list.d/fullstaq-ruby.list | |
curl -SLfO https://raw.githubusercontent.com/fullstaq-labs/fullstaq-ruby-server-edition/main/fullstaq-ruby.asc | |
apt-key add fullstaq-ruby.asc | |
apt update | |
apt install -y fullstaq-ruby-3.1.2-jemalloc | |
echo 'export PATH="/usr/lib/fullstaq-ruby/versions/3.1.2-jemalloc/bin:$PATH"' >> ~/.bashrc | |
wget http://fr.archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi8_3.4.2-1ubuntu5_amd64.deb | |
sudo dpkg -i ./libffi8_3.4.2-1ubuntu5_amd64.deb | |
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - | |
apt install -y nodejs | |
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null | |
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list | |
apt update && apt install -y yarn | |
apt upgrade | |
loginctl enable-linger root |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run these commands as root on the VPS | |
adduser --disabled-password deployer < /dev/null | |
mkdir -p /home/deployer/.ssh | |
cp /root/.ssh/authorized_keys /home/deployer/.ssh | |
chown -R deployer:deployer /home/deployer/.ssh | |
chmod 600 /home/deployer/.ssh/authorized_keys | |
mkdir -p /var/www | |
chown deployer:deployer /var/www | |
loginctl enable-linger deployer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment