---
title: "How to install a web development environment on a VPS or a dedicated server"
description: "Find out how to install a web development environment on a VPS or an OVHcloud dedicated server"
url: https://docs.ovhcloud.com/en/guides/bare-metal-cloud/virtual-private-servers/install-env-web-dev-on-vps
lang: en
lastUpdated: 2025-10-15
---
# How to install a web development environment on a VPS or a dedicated server

## Objective

If you would like to install a CMS (**C**ontent **M**anagement **S**ystem) on your VPS (e.g. WordPress), you will need to install a web development environment on your VPS or dedicated server in advance. The main services to install are:

- **PHP**: PHP is one of the most widely used languages for building websites. You need to install PHP so that your website can run scripts and dynamic features. It is best to install the most recent PHP version.
- **Web server**: The web server is essential for serving your website pages. The most popular web servers include Apache and Nginx, each with their own advantages in terms of flexibility, performance and ease of configuration.
- **DBMS**: To store, manage and retrieve your data efficiently, you will need a DBMS (**D**ata**B**ase **M**anagement **S**ystem). MySQL, PostgreSQL and MariaDB are the most widely used DBMS in web development.

**Find out how to manually install a web development environment on an OVHcloud VPS or dedicated server.**

:::warning
This tutorial will show you how to use one or more OVHcloud solutions with external tools, and the changes you need to make in specific contexts. You may need to adapt the instructions according to your situation.

We recommend that you contact a [specialist service provider](https://partner.ovhcloud.com/en-gb/directory/) or reach out to [our community](https://community.ovhcloud.com/community/en) if you face difficulties or doubts concerning the administration, usage or implementation of services on a server.

:::

## Requirements

- A \[VPS] solution ([https://www.ovhcloud.com/en-gb/vps/](https://www.ovhcloud.com/en-gb/vps/)) or a [dedicated server](https://www.ovhcloud.com/en-gb/bare-metal/) in your <ManagerLink to="/">OVHcloud Control Panel</ManagerLink>
- Administrative (sudo) access to your server via SSH

## Instructions

Log in to your VPS via SSH with your username and password.

### Update the package index

Before installing the components, update the package list:

```bash
sudo apt update
```

Apply the available updates:

```bash
sudo apt -y upgrade
```

### Install PHP

Install PHP:

```bash
sudo apt install -y php php-cli php-fpm php-xml php-gd php-curl
```

To check that PHP is installed properly, enter the following command:

```bash
sudo php -v
```

If PHP is correctly installed, you should see this message:

![env dev web](/images/bare-metal-cloud/virtual-private-servers/install-env-web-dev-on-vps/result_php_v.png)
### Install a web server

:::info
For this guide, we choose Nginx, but you are free to install the web server of your choice.

:::

Install Nginx:

```bash
sudo apt install nginx -y
```

To verify that Nginx is installed properly, enter the following command:

```bash
sudo nginx -v
```

If Nginx is correctly installed, you should see a message like this:

![env dev web](/images/bare-metal-cloud/virtual-private-servers/install-env-web-dev-on-vps/result_nginx_v.png)
If you have any queries, please refer to [Nginx official website](https://www.nginx.com/).

### Install a DBMS (**D**ata**B**ase **M**anagement **S**ystem)

:::info
Select the tab corresponding to the DBMS you want to use. The appropriate PHP extension will be installed in each case.

:::


**MySQL / MariaDB**

Install MariaDB (or MySQL) and the associated PHP extension:
```bash
sudo apt install -y mariadb-server php-mysql
```
Secure the installation:
```bash
sudo mariadb-secure-installation
```
Set a password for your DBMS and follow the on-screen instructions. Once the MariaDB (or MySQL) installation is complete, the following message should appear:
![env dev web](/images/bare-metal-cloud/virtual-private-servers/install-env-web-dev-on-vps/success_msg_mariadb.png)

**PostgreSQL**

Install PostgreSQL and the corresponding PHP extension:
```bash
sudo apt install -y postgresql postgresql-contrib php-pgsql
```
Create a database and a user (example):
```bash
sudo -u postgres psql -c "CREATE DATABASE db_name;"
sudo -u postgres psql -c "CREATE USER db_user WITH ENCRYPTED PASSWORD 'strong_password';"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE db_name TO db_user;"
```


### Conclusion

You have just installed PHP, an Nginx server, and a DBMS (MariaDB/MySQL or PostgreSQL). You now have a functional web development environment on your VPS or OVHcloud dedicated server. If you wish, you can now install the CMS (**C**ontent **M**anagement **S**ystem) of your choice, such as WordPress. To find out more, please read the guides “[How to install WordPress with WP-CLI on a VPS or a dedicated server](/en/guides/bare-metal-cloud/virtual-private-servers/install-wordpress-site-on-vps.md)” and “[How to install WordPress with Docker on a VPS or a dedicated server](/en/guides/bare-metal-cloud/virtual-private-servers/install-wordpress-docker-on-vps.md)”.

For some general tips on securing a GNU/Linux-based server, see our guides:

- [Securing a VPS](/en/guides/bare-metal-cloud/virtual-private-servers/secure-your-vps.md)
- [Securing a dedicated server](/en/guides/bare-metal-cloud/dedicated-servers/securing-a-dedicated-server.md)

## Go further [](#)
[How to install WordPress with WP-CLI on a VPS or a dedicated server](/en/guides/bare-metal-cloud/virtual-private-servers/install-wordpress-site-on-vps.md)

[How to install WordPress with Docker on a VPS or a dedicated server](/en/guides/bare-metal-cloud/virtual-private-servers/install-wordpress-docker-on-vps.md)

[Securing a VPS](/en/guides/bare-metal-cloud/virtual-private-servers/secure-your-vps.md)

[Securing a dedicated server](/en/guides/bare-metal-cloud/dedicated-servers/securing-a-dedicated-server.md)

For specialised services (SEO, development, etc.), contact [OVHcloud partners](https://partner.ovhcloud.com/en-gb/directory/).

Join our [community of users](https://community.ovhcloud.com/).
