Debian [Ubuntu/Raspbian] installation script

Xubuntu 20.04 for lightweight purpose

  • Update & install required packages
sudo apt update && sudo apt -y upgrade

sudo apt -y install software-properties-common

sudo apt -y install curl git unzip perl libnet-ssleay-perl openssl openssh-server libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python
  • Web server
sudo apt -y install apache2 apachetop

Or use Nginx ( Suggested )

sudo apt -y remove apache2
sudo apt -y install nginx
sudo apt -y install php8.0-fpm
  • MySQL
sudo apt install -y mysql-client mysql-sandbox mysql-server mysql-testsuite
sudo /etc/init.d/mysql restart
  • MariaDB ( Suggested )
sudo apt -y install mariadb-server
sudo /etc/init.d/mysql restart

Setup your root password.

sudo mysql_secure_installation

And login with sudo

sudo mysql -uroot -p

We’ll need switch to mysql_native_password by use

USE mysql;
UPDATE user SET plugin='mysql_native_password' WHERE User='root';
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
FLUSH PRIVILEGES
  • PHP

For x86

sudo add-apt-repository ppa:ondrej/php && sudo apt update

For ARMv7l

sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list

Than now you can install your needed packages

sudo apt -y install php-imagick php-gd php-cli php-mbstringphp-pecl-http php-uploadprogress imagemagick \
php8.0-apcu php8.0-cli php8.0-curl php8.0-dev php8.0-gd php8.0-http php8.0-igbinary php8.0-imagick php8.0-intl php8.0-mbstring php8.0-mcrypt php8.0-memcache php8.0-memcached php8.0-mongodb php8.0-mysql php8.0-oauth php8.0-opcache php8.0-pcov php8.0-raphf php8.0-soap php8.0-sqlite3php8.0-xml php8.0-xmlrpc php8.0-xsl php8.0-yaml php8.0-zip 

These are optional

sudo apt -y install php-xdebug php8.0-xdebug
sudo apt -y install php-memcache php-memcached memcached
sudo pecl install raphf
sudo pecl install propro
sudo pear install http
sudo pear install http2
sudo pecl install mongodb
  • Composer
curl -sS https://getcomposer.org/installer -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
  • Node JS

For x86 only

curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -

echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

sudo apt update && sudo apt install yarn
  • Caching server
sudo apt -y install redis redis-server redis-tools memcached
  • Supervisor
sudo apt -y install supervisor
  • Docker

For x86 only

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker $USER

For ARMv7l

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
  • General SSH
ssh-keygen -t ed25519 -C "jooservices@gmail.com"
https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

Pages: 1 2 3 4

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Up ↑

%d bloggers like this: