After you’ve set up a Minecraft server, you should add yourself and trusted friends as operators (called OPs) to give them access to access to administrator commands while in-game.
Method 1: Add an Admin Using /op username
Within the Minecraft server console, type op username, replacing username with the Minecraft username of the player you’d like to add as operator.
This command will grant immediate admin access to the players you add, including access to all plugins (unless otherwise configured), without a need to restart the server.
Method 2: Add an Admin to your ops.txt file
In your Minecraft server’s root directory, there should be a file called ops.txt (create it if it’s not there). To set a user as admin, simply add their username to a new line, save the file, and restart your server.
Now you know how to add a player as admin to a Minecraft server!
Customize Admin Access Levels
By default, all operators will have the same level of access to the server – you should install a permissions plugin to designate different access levels for your admins. Plugins such as GroupManager or PermissionsEX are popularly used, but you should search for a permissions mod that fits your needs and server specifications.
We’ll go into further detail into how to create different access levels for your Minecraft server admins in another guide.