Install all PHP development software with a single script.
This script also installs the Dockerizer tool that is designed to:
- Install any Magento 2 version in 1 command.
- Add Docker files to your existing projects in one command.
It is possible to rerun this script to update software and install new packages. It will not break anything. A backup of your ~/.bash_aliases
file will be created during the update.
Automated environment installation script for Ubuntu 20.04-22.10 x64 or Ubuntu-based distributions:
sh ubuntu_20.04-22.04_x64.sh
Important! Do not run it with sudo
or when you switch to the root user. Never. Otherwise, a lot of things
may have insufficient permissions.
Scripts can be rerun after upgrading your Ubuntu installation to the newer version (for example, from 21.10 to 22.04).
Everything is Docker-based. See Dockerizer and Full YouTube presentation
curl
: A Tool to transfer data to or from a serverDiodon
: clipboard managerDocker + docker-compose
: Spin up development environmentshtop
: Process managergit & git-gui
: Version control systemGoogle Chrome
: Browserguake
: Pulldown terminalmc
(Midnight Commander): Console file managermkcert
: Generating trusted SSL certificates for local developmentnodejs, php
: Needs no introductionPHPStorm
: IDEShutter
: Making and editing screenshotsSublime Text
: Text editorSlack
: MessengerTweaks
: Ubuntu fine-tuningvim
: CLI text editor which you can't exit fromVirtualBox
: Virtualization tool for setting up Windows and other OS
PHP modules that are installed:
- bz2
- cli
- common
- curl
- intl
- mbstring
- mysql
- opcache
- readline
- ssh2
- xml
- xdebug
- zip
PHP Tools:
- Dockerizer:
~/misc/apps/dockerizer_for_php/
- Magento 2 coding standard tools:
~/misc/apps/magento-coding-standard/
- PHP_CodeSniffer:
~/misc/apps/php-quality-tools/
- PHPMD - PHP Mess Detector:
~/misc/apps/php-quality-tools/
- PHPStan - PHP Static Analysis Tool:
~/misc/apps/php-quality-tools/
- Psalm:
~/misc/apps/php-quality-tools/
- PHP Magic Number detector:
~/misc/apps/php-quality-tools/
xDebug
is configured automatically and does not require additional adjustments if you use PHPStorm. php.ini
settings are updated for development environment.
You may also want to download the free Microsoft IE/Edge virtual machines for VirtualBox
There are a lot of useful aliases added to the ~/.bash_aliases
file.
Docker-related aliases:
COMPOSITIONS
: Show a list of Docker containers and their composition locations
Aliases for docker-compose
(mostly expect to have docker-compose.yaml
and docker-compose-dev-tools.yaml
files in the current directory):
UP
: Starts compositions generated by Dockerizer in the development modeDOWN
: Stops compositions generated by Dockerizer without removing volumesDOWNV
: Stops compositions generated by Dockerizer and removes volumesPS
: Shows the status of all containers in the current directoryRESTART
: Restarts compositions generated by DockerizerSTART
: Starts compositions generated by DockerizerSTOP
: Stops compositions generated by Dockerizer
Dockerizer V3 aliases:
DOCKERIZER
: Path to Dockerizer to make other aliases shorterBUILD
: Run Dockerizer commandcomposition:build-from-template
from any directorySETUP
: Run Dockerizer commandmagento:setup
from any directoryREINSTALL
: Run Dockerizer commandmagento:reinstall
from any directoryCONNECT
: Run Dockerizer commanddocker:mysql:connect
. Use it from the directory withdocker-compose
files containingmysql
serviceIMPORTDB
: Run Dockerizer commanddocker:mysql:import-db
. Use it from the directory withdocker-compose
files containingmysql
serviceEXPORTDB
: Run Dockerizer commanddocker:mysql:export-db
. Use it from the directory withdocker-compose
files containingmysql
service
See Dockerizer Wiki for more information about its commands and capabilities.
Enter Docker containers:
PHP
: Enter thephp
container. Use it from the directory withdocker-compose
files containingphp
servicePHPROOT
: Enter thephp
container with root privileges. Use it from the directory withdocker-compose
files containingphp
service
PHP container aliases:
CI
: Runcomposer install
in thephp
container. Use it from the directory withdocker-compose
files containingphp
service
Magento 2 aliases. Run them in the directory containing the docker-compose.yaml
file containing php
service:
MAGENTO
: Alias forphp bin/magento
command. Can be used to call Magento commands or as a part of other aliasesCC
: Runphp bin/magento cache:clean
;CF
: Runphp bin/magento cache:flush
;IR
: Runphp bin/magento indexer:reindex
;SU
: Runphp bin/magento setup:upgrade
;SDC
: Runphp bin/magento setup:di:compile
;URN
: Runphp bin/magento dev:urn-catalog:generate
and replace/var/www/html
with$PROJECT_DIR$
(internal PHPStorm variable).MODEDEV
: Set Magento 2 mode todeveloper
MODEDEF
: Set Magento 2 mode todefault
MODEPROD
: Set Magento 2 mode toproduction
Other aliases:
CR
: Remove all Magento 2 auto-generated files inpub/static/
,var/
and other directoriesMCS
: Run Magento 2 coding standard checks with--severity=1
(strict check). Usage:MSC <path/to/the/code/to/check>
(see Magento Coding Standard)MND
: Run PHP Magic Number detector
If the certificates generated by the mkcert are insecure then run the following and restart the browser:
mkcert -install
This may happen because browsers are not started during the software installation and local CA is not yet trusted by the browser.
-
Create bookmark for at least
~/misc
folder in Nautilus (file manager) - just move the folder to the left sidebar of Nautilus to add it to bookmarks. -
Use Ubuntu
Startup Applications
to automate launching apps on system startup. -
Use
Guake
pulldown terminal as an alternative to the Terminal application. Set it to, for example, F1 key. Set switching tabs to ALT+1, ALT+2 and so on because this is a default shortcut for many other apps. Use itsStart Guake at login
configuration to add it to the Startup applications - otherwise Guake will delete itself from the list. For Ubuntu on Wayland you must set a custom shortcut forguake-toggle
command instead of using Guake preferences.
- Enable workspaces in Ubuntu and learn how to use them (if not yet) and how to move windows between workspaces. You may like using static number of workspaces instead of dynamically adding/removing them.
If you prefer to loop through the current workspace apps only rather than all apps on all workspaces:
gsettings set org.gnome.shell.app-switcher current-workspace-only true
-
Use
Tweaks
to fine-tune your system. -
It is possible to customize terminal output to show current time and Git branch when you-re inside the repository. Use
$PS1
like this in your~/.bash_aliases
:
# Let's make the prompt more colorful and show Git branch if available
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;35m\][\d \t] \[\033[01;33m\]\w\[\033[01;31m\]\[\033[01;34m\]$(__git_ps1)\[\033[01;31m\] > \[\033[01;32m\]'
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\w\a\]$PS1"
;;
*)
;;
esac
Or take this one as an example and modify it for your needs. Be sure to backup the file before that.