An operator, or op, is a player who may use admin commands in the game, such as changing game mode, teleporting or banning. A new server has no operators, so the first one has to be set from outside the game. The panel Console does that for you.
Op yourself on a Java server
Open your server in the panel. Make sure it is Online.
Click the Console tab.
Click the box that says Type a command.
Type op followed by your Minecraft name, exactly as it is spelled in the game, for example op Steve, and press Enter. Do not type a slash in the Console.
The Console answers that the player was made a server operator. If you are in the game, you can use commands at once, for example /gamemode creative.
With Online mode on, which is the default, the name must belong to a real Java account. If the player has never joined, the server looks the name up. If it cannot find it, check the spelling.
Leave Online mode on. If it is off, anyone can join with your name and receive your operator rights. See How to join your Minecraft server.
Op someone else, or remove an op
Anyone who is already an operator at level 3 or higher can run these in the game, with a slash. You can also run them in the Console, without a slash.
Command
What it does
op Alex
Makes Alex an operator
deop Alex
Removes Alex's operator rights
Give operator rights only to people you trust. An operator at the top level can stop the server and change anything.
Operator levels
Operators have a level from 1 to 4. The level decides what they can do.
Level
What the operator can do
1
Bypass spawn protection and build inside it
2
Also use most cheat commands, such as gamemode, give, tp and time, and use command blocks
3
Also manage players: op, deop, kick, ban and whitelist
4
Also use server control commands such as stop and save-all
The level a new operator gets is the Operator level setting under Settings, then Server Properties (Java). It is 4 unless you change it. To give new operators less power, set it to 2 or 3 and restart the server. See Minecraft server properties explained.
The Minecraft Wiki documents a file called ops.json in the main server folder, which you can open from Files, as holding each operator's ID, name and level. If the file looks different on your version, leave it alone. Edit it only with the server stopped, and prefer the op command, because it fills in the details for you.
Permissions on plugin servers
Operator levels are all or nothing. On Paper, Purpur or Spigot you can give players finer permissions, such as using homes but not teleporting others, with a permissions plugin such as LuckPerms. Plugins are installed from the Modding tab. See How to add mods, plugins and modpacks. The Settings page may also list a permissions.yml file for these types.
Bedrock servers
These steps are for the Bedrock server type, not Pocketmine. Pocketmine is a different program with its own settings, under Server Properties (PocketMine), and it has no Game Settings options apart from its version. If you run Pocketmine, type help in the Console to see the commands it knows, and open a ticket if you cannot make yourself an operator. See How to run a Minecraft Bedrock server.
Bedrock has three roles instead of levels: visitor, member and operator. Visitors cannot build, members can, and operators can use commands.
Open the Console tab, type op followed by the player's name and press Enter. Microsoft's server guide lists this as a server console command.
The role is stored in permissions.json. A new player's starting role is Default permission level under Settings, then Server Properties (Bedrock), with the choices visitor, member and operator.
Cheat commands only work when Allow cheats is on. You find it under Settings, then Game Settings. Restart the server after you change it.
If op does nothing in the Console, open a ticket with your gamertag and we will help. See How to open a support ticket.