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';
  • 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
echo "deb $(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 -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
  • Node JS

For x86 only

curl -fsSL | sudo -E bash -
sudo apt-get install -y nodejs
curl -sS | sudo apt-key add -

echo "deb 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 \

curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \
  $(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
sudo usermod -aG docker $USER

For ARMv7l

curl -fsSL -o
sudo sh
sudo usermod -aG docker $USER
  • General SSH
ssh-keygen -t ed25519 -C ""

Pages: 1 2 3 4

Leave a Reply

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

You are commenting using your 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: