What is Symfony
Symfony is a widely popular PHP framework, commonly used for developing web applications. Its key advantages include being open-source, having a large and active user community, and offering up-to-date, comprehensive documentation.
Before setup
To install Symfony you need a server meeting the following requirements:
- Server with at least 2Gb RAM and 20Gb disk space;
- Actual operation system (Ubuntu 20.04 as this article example);
- Privileged user acess;
- Web-server, PHP 7.0 or newer, database server installed.
The fastest way to prepare server to main product installation is install any web-panel, e.g. HestiaCP. When panel is ready, do these steps:
- Check current PHP version. You may do it via panel or run simple command in the SSH-console;
php -v
- Open the SSH-session and install required php-extension:
apt-get install -y php<your_version>-sqlite3
- Login to the panel and create "simple", non-administrative user. Click to Users > Add user, fill the required info and then Save button;
- Login as created user;
- Create web-domain via panel;
- Install composer in the website location:
cd /tmp
curl -sS https://getcomposer.org/installer -o composer-setup.php
php composer-setup.php --install-dir=/bin --filename=composer
- Install the tool to make final check:
apt install -y curl
curl -1sLf 'https://dl.cloudsmith.io/public/symfony/stable/setup.deb.sh' | sudo -E bash
apt install -y symfony-cli
- Run the checking procedure:
symfony check:requirements
As you see, configuration is OK, preparing is finished, go to the next step.
Framework installation
It is very simple. To make your own demo-project just run:
su <non-privileged account>
composer create-project symfony/website-skeleton myproject
Now you can open URL http://<your_domain>/<your_appname>/public. If you see page as below - setup finished, take a coffee-break.
Conclusion
In this article, we explained what the Symfony Framework is and provided a detailed, step-by-step guide on how to install it on your Ubuntu 20.04 server. With Symfony’s powerful features and robust community support, setting up this framework on your server enables you to build scalable and maintainable web applications efficiently. Follow these instructions to get started quickly and take advantage of everything Symfony has to offer.