DEV Community

Cover image for Ubuntu 20.04, After installation actions
Sohag Hossain
Sohag Hossain

Posted on • Updated on

Ubuntu 20.04, After installation actions

Hello, when its come to the time preparing you'r machine after a fresh setup it takes some time or couple of days for some guys. Therefore, here are some installation lines which may helpful for some guys.

  • sudo apt-get update && sudo apt-get upgrade -y
  • sudo snap install code --classic
  • sudo snap install skype --classic
  • sudo apt install git-all
  • sudo apt install npm
  • sudo apt install vim
  • sudo apt install apache2
  • sudo ufw app list
  • sudo ufw enable
  • sudo ufw allow 'Apache'
  • sudo add-apt-repository ppa:ondrej/php
  • sudo apt install libapache2-mod-fcgid
  • sudo apt install software-properties-common
  • sudo apt install mysql-server

To change the root password

  • sudo mysql
  • ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'desired_password';

  • sudo apt-get install sshpass

To install composer

Generate ssh key for github

  • ssh-keygen -t ed25519 -C "" && ssh-add ~/.ssh/id_ed25519 // to show the key run : "cat ~/.ssh/" copy-paste in github settings SSH key

Install various php versions along with some extensions

  • sudo apt-get install php8.0 libapache2-mod-php8.0 php8.0-bcmath php8.0-cli php8.0-common php8.0-curl php8.0-dev php8.0-gd php8.0-intl php8.0-json php8.0-ldap php8.0-mbstring php8.0-mysql php8.0-opcache php8.0-pgsql php8.0-soap php8.0-sqlite3 php8.0-xml php8.0-zip

  • sudo apt-get install php7.4-bcmath php7.4-cli php7.4-common php7.4-curl php7.4-dev php7.4-gd php7.4-intl php7.4-json php7.4-ldap php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-pgsql php7.4-soap php7.4-sqlite3 php7.4-xml php7.4-zip

  • sudo apt-get install php7.2 php7.2-fpm php7.2-mysql libapache2-mod-php7.2 -y php7.2-apcu php7.2-cli php7.2-common php7.2-curl php7.2-imagick php7.2-intl php7.2-json php7.2-mbstring php7.2-mcrypt php7.2-memcache php7.2-xdebug php7.2-xml php7.2-yaml php7.2-zip

  • sudo apt-get install php7.0 php7.0-fpm php7.0-mysql libapache2-mod-php7.0 libapache2-mod-fcgid -y php7.0-apcu php7.0-cli php7.0-common php7.0-curl php7.0-imagick php7.0-intl php7.0-json php7.0-mbstring php7.0-mcrypt php7.0-memcache php7.0-xdebug php7.0-xml php7.0-yaml php7.0-zip

If you want to install PHP5.6 as well

  • sudo apt-get install python-software-properties && sudo add-apt-repository ppa:ondrej/php && sudo apt-get -y update && sudo apt-get install -y php5.6 && sudo apt-get install php5.6-fpm php5.6-mysql libapache2-mod-php5.6 libapache2-mod-fcgid -y php5.6-apcu php5.6-cli php5.6-common php5.6-curl php5.6-imagick php5.6-intl php5.6-json php5.6-mbstring php5.6-mcrypt php5.6-memcache php5.6-xdebug php5.6-xml php5.6-yaml php5.6-zip

If you're fan of ZSH then

Install zsh plugins.

If you also like zsh plugins, you can edit the ~/.zshrc like:
insdie ~/.zshrc replace plugins value with (git z zsh-autosuggestions)

install xdebug

  • sudo apt-get install php{version_number}-xdebug

Top comments (4)

maruf1745 profile image

There have multiple PHP version, it's nice. If you post PHP version switcher it's better for us.

narutou52406885 profile image
Naruto Uzumaki

Thanks for sharing this new update on DevOps which is very helpful for me.
I'm still learning PHP in IntelliMindz training in Chennai

sh6210 profile image
Sohag Hossain

Thanks for your feedback. I've wrote a post about PHP switcher on other site.
Here's the link:

leslieeeee profile image

If you are macos user, is worth to try. You don't need to spend some time or couple of days to setup anything. Just download it and you can use it immediately. You can run multiple PHP versions simultaneously and switch between them effortlessly.
Honestly, this tool has greatly simplified my PHP development and is definitely worth trying!