First, the minimum installation principle
Install only those packages that you really need. If there are unwanted packages, clear them. The smaller the number of packages, the less likely it is that the code will not be patched. Before installing any software and dependent packages (such as owncloud), you should read the documentation for the owncloud and install only those packages that it needs.
II. Minimum Operating Principles
Run only those services that are required. Many distributions or packages may turn on some services to run on different ports. This can pose a security risk.
Iii. the principle of restricted access
It's like you don't give your keys to someone you know, and you don't give the right to access to the server to anyone who knows it casually. Once this rule is clarified, access to the server can be limited. Keep that in mind: it doesn't stop the idea of a bad person who is determined to destroy your server. However, its role is to add a layer of security for your server, prevention is just leackage check criminals.
Iv. minimum use of the root principle
Super user rights are relatively large, easy to use dangerous operations, so use more ordinary users, less use of root users.
V. Port changes
Port change is also a common security technique, the default port everyone knows that it's easy to be sniffed at and attacked by others.
Log in Using secret key
It is easier to access the server via SSH via a password-free login and completely disable password authentication to add another layer of security. It's important to keep in mind that you can only log in to your server from the machine that created the SSH key.