Hi Osa,
>> wrong look the image, that server only had 3 open ports, 443, 80 and remote desktop.
So it's important to understand what an "open port" means. It means a program is listening on the port. In itself a port being open or not is not the important thing - and the port number is irrelevant - what is important is the program listening on the port.
Of the 3 ports you listed, by _far_ the most vulnerable is the Remote Desktop port. This is because the program listening on that port gives the user complete access to the computer. Also, because it is so powerful it is subject not only to back-door attacks, but also brute-force attacks. Since the login to RDP is "visible to all [1]" it's easy to simply try common login names (Administrator) with lots and lots of password attempts. Most people unfortunately have weak passwords.
[1] The best thing you can do for RDP is limit the IP addresses that can access the machine. In other words, on the server side, limit incoming RDP connections not just to a user/password but also to a specific IP address. Then you greatly reduce the risk of an attack.
[2] Of course machines can be compromised by vectors other than just direct entry. Receiving email on the machine is always a possibility. Ransomeware can also spread through a LAN if the server is on a LAN.
By comparison, having a web server listen on a port is much safer because web servers are designed to limit machine access. A web server user for example cannot read, or write, to the bulk of the server's hard drive. and by design the functions it can do are limited (even for logged in users.)
Also, once you have opened one port for the web server to listen on (443) it doesn't make any difference if it's also listening on other ports (like port 80) because it's the same program listening on both. If there is a flaw, it's not limited to any one specific port.
>> Just for curious, is possible that letsencrypt renew automatically? because with a port 80 open and a program running as service the certificate expiry after 90 days,and i have to enter with a version that does not run as a service for it to be renewed and always have to delete the directory where the certificate
I think what you are saying is that the certificate will renew if running as an exe, but not if running as a service?
that's likely to be caused by the account you are running the service in - whether that account lets you spawn the openssl.exe program or not. I recommend changing the service account settings to match your user account.
cheers
Bruce