Yes. Significantly safer than a Windows system in the default config.
If you expose a Windows server default install to the internet it will be compromised in days. (I don't know how. I do know AWS was very unimpressed with me.)
In contrast Linux systems are often set up that way without issue.