Why doesn't God have to keep his own commandments such as "Do not murder"? In the Bible God gives many commands, but he doesn't seem to have to keep all of them himself.

For example in the Ten Commandments God instructs his people not to murder (Exodus 20:13). But God frequently executes people himself, such as when he killed Korah and his 250 followers in Numbers 16.

Why doesn't God have to keep his own commandment not to kill?  To disobey any of God's commandments is sinful. So how can God ignore them? Does the Bible explain why?
This question is about authority. It is wrong for you to discipline children unless you are their parent, or their teacher, or their sports coach etc. The relationship you have determines what authority you have over someone.

As our creator, God has complete authority over everyone. It is entirely right for him to kill any creature he made at any time for any reason. But we do not have that authority or right. We're not God.

Through the Bible you can see that at times God gives up his prerogative to kill. God's promise to Cain in Genesis 4 suggests that before the flood there were no situations when God allowed people to kill each other. After the flood in Genesis 9 God instructs his people to execute murderers and animals who kill people. In the Mosaic law he prescribes executions for many more crimes and sins. Fast forward to the New Testament, and Romans 13:1-5 says that God has given our civil rulers the right to punish wrongdoers. But in all of these cases a human's authority to kill people is always derived from God's own authority. None of us have that right in and of ourselves.

(And just for the record, the commandment is not "do not kill", but instead "do not commit murder". See this other question for an explanation of why the KJV says 'kill'.)