Aside from using server commands, there are only four ways to get gunpowder: Creepers Ghasts Dungeon Chests Witches Of those four, creepers would be the easiest way to reliably (and safely) get gunpowder.
Your best bet would be to make a mob farm (also called mob traps or mob spawners).
The general idea is to set up a dark room for mobs to spawn in, and have them funneled into an area where they are either easy to kill or die due to the environment or traps.
This question covers how to make mob traps, which I also linked above.
gaming.stackexchange.com/users/8350/Wipqozn
The easiest way is to build a mob spawner and just afk overnight.
Otherwise yes, I wish you happy creeper hunting.
gaming.stackexchange.com/users/8410/Ken
Assuming you don't want to build a mob farm (which is some type of a large area filled with dark bits where all monsters--including creepers--will naturally spawn and then be funneled to a central area and killed automatically)
you need to find a way to hunt creepers easily.
My method: Dig a 4x4 pit that is 2 deep.
Wait until night.
Lure creepers until they fall into the hole.
Carefully kill them with a sword from the edge of the hole.
This is dangerous, naturally, but I generally don't wear armor and don't go gunpowder-hunting with anything in my pockets that I can't afford to lose.
Mobs are a bit smarter now, and sometimes don't like to wander off of cliffs.
To encourage them to fall, you can place signs with their backs against the dirt blocks on the inside edge of the pit.
Creatures mistake the tops of signs for something they can walk on and fall when they attempt.
Many others go out hunting at night with torches, food, dogs, and the best weapons and armor they can get.
Many people I respect swear by using TNT to mine quickly.
In my experience it's more fun, but not any faster or more efficient (especially after factoring in the time and materials spent in the hunt) unless you've got a mob farm and thus a nigh infinite supply of TNT.
I use TNT only when I gather it incidentally, and then primarily for making large pits or flattening things.
gaming.stackexchange.com/users/25080/Fnord Prefect
I think the easiest way is to kill time until a creeper spawns during nighttime, lure it far away from your build if you have one, and kill it as quickly as possible.
This is the most efficient, but also most risky way to do it.
Another way is to build a high darkroom, a low floor, and a tunnel between them.
That way, if any mob spawns, they have a chance of falling through the tunnel, dying, and giving you their drops.
Plus, you get other mobs' drops as a bonus.
gaming.stackexchange.com/users/27009/techieboy45
I would advise putting up three rows of dirt blocks in front of a dark cave.
You can then dig the middle dirt out so when the mobs spawn there you can kill them with a bow or a sword.
gaming.stackexchange.com/users/30560/Matthew
The quickest way to get gunpowder is to make a mob farm by making a really dark place with water going down a hole with a massive drop into lava with water underneath where you can collect the drops from the bottom.
gaming.stackexchange.com/users/31428/Joe
What I saw from a video is that the best way to get string/arrows/bones/gunpowder is to make a mob trap.
To make a mob trap you need to have a sealed, very dark and very high up room with no torches and no doors and you also have to have water flowing into a hole in the middle, the hole has to be deep,
at the bottom you have to have a bit built out that's got lava and signs to hold the lava, once you've done that then you build a bit out and put water down so that when a mob/mobs spawn they fall down the hole and the water pushes the mob/mobs towards the lava so the mob/mobs die and the item(s)
get pushed towards a point ready for you to pick them up.
gaming.stackexchange.com/users/37104/the awesome ninja
Mob farms are the best.
You have to make sure that no light can get into it.
If you want it quickly, cheat and use commands.
gaming.stackexchange.com/users/37804/fionn
I've found a quite easy, and reliable method to hunt creepers.
This method will on the other hand, require a bit of luck.
The way I did it was to go to the nether, and mine quartz till I reached level 30 (It goes insanely fast).
After that I enchanted my diamond sword, and got Fortune III on it.
When killing creepers with this sword, you will obtain approximately 1-4 gunpowder from each creeper.
It is not a dangerous job to melee them with a diamond sword, because they only need 2 hits from it.
(Perhaps only just even 1, with sharpness).
Just make sure to take 'em out one at a time.
gaming.stackexchange.com/users/54955/Faxu
If you're brave enough to go creeper hunting you will want to follow these instructions: Obtain a well built, well lit, and high up shelter.
The best way to get one of these shelters is to build inside a cliff about 36 blocks high.
It will most likely have coal and iron,two resources you will need for this to work.
Obtain the following: Stone swords About 15 pieces of food About 5 full stacks of dirt/cobblestone
And if you pick cobblestone, a iron pickaxe or 2 stone pickaxes.
Place in a chest and put a sign over it that says "Creeper Hunting".
I forgot.
You must have a biome with lots of water!
Wait in your shelter until night.
If your shelter is well lit as it's supposed to be, there should be NO MOBS except sheep, cows, chickens, and pigs.
If there ARE any.
Go outside and go underwater.
Your house SHOULD be near the edge of the water.
Pop up.
You should see at least 1 creeper.
Now the fun part.
Go under the creeper and hit it with your sword.
You now have gunpowder!
Turn it to peaceful mode and make some TNT.
gaming.stackexchange.com/users/43273/Silver Dragon
I've logged a few hours into Minecraft and so far I've managed to dig a rather wide hole straight to bedrock.  I know that in the game, you can mine much faster than a pickaxe if you have TNT, which requires a fair amount of gunpowder and sand.  Sand is easy to obtain, but what about the gunpowder?  Do I have to run around killing mob after mob at night or is there a quicker way to get it?
What is the quickest/easiest way to obtain gunpowder?
gaming.stackexchange.com
<minecraft-java-edition>
gaming.stackexchange.com/questions/27158
gaming.stackexchange.com/users/10405/RLH
There are several ways to get gunpowder. The easiest way is to kill time until a creeper spawns. You can also make a mob farm or hunt creepers. There is a number of ways that seem to be successful, with more prominent the creation of mob farms and the hunting of creepers.
There is a number of ways that seem to be successful, with more prominent the creation of mob farms and the hunting of creepers.