I would like to create a smart monitoring system (different sensors, temperature, humidity, etc.) and be able to see these values from anywhere. I already have all the setup (I use an esp8266)
I understood that I have to use a database, a server and a website, but it is not clear to me. (I would like to use a raspberry pie as a server)
Can you help me with some ideas or links where I can learn.
If you really want to do it that way, you will have to use several different technologies and poke a hole in your router's firewall, which is a security risk. Look at MySQL, Apache and PHP, though of course there are plenty of other options.
Alternatively, look at cloud based IoT solution - Arduino has one, as do many other vendors.
I would probably buy a domain (e.g. qatalin.org) and use a hosting provider where you can host a php/mysql based website. The ESP8266 can be the client that dumps the data in the mysql database and the website is used to display the data.
You will need a number of security measures, not sure what exactly.
That may be all you need but, if you haven't already done so, you might consider adding a local SD card to record data if the Internet goes down - also for local use.
Then consider.. What is Adafruit IO? | Welcome to Adafruit IO | Adafruit Learning System
This is Internet of things IoT, of which there are several. The vital thing about IoT is that it saves you from re-inventing the wheel. You post the data, they do the rest - including handling the security.
You will find a lot of stuff on YouTube, usually by smart little kids in Pakistan using ESP32. The ESP8266 is just as valid.