Despite the common belief that you must take ibuprofen with food, you can safely take low-dose ibuprofen (up to 1200 mg daily in divided doses for 1 to 7 days) on an empty stomach, and this provides faster pain relief than taking ibuprofen with food.
For one-time, fast relief of pain, taking ibuprofen on an empty stomach may be fine. But you might consider pairing it with an over-the-counter magnesium antacid to protect your stomach...

Taking ibuprofen, a common nonsteroidal anti-inflammatory drug (NSAID), provides effective relief from pain, inflammation, and fever. Its mechanism of action involves the gastrointestinal (GI) tract, and taking it on an empty stomach significantly increases the risk of side effects.

Who Should Avoid Taking Ibuprofen On An Empty Stomach? Elderly individuals, those with a history of ulcers or gastritis, people on blood thinners or corticosteroids, and heavy alcohol consumers should avoid taking ibuprofen without food due to higher risks of stomach damage and bleeding.

Taking ibuprofen on an empty stomach is generally safe for occasional low doses but increases the risk of stomach irritation, nausea, or serious issues like ulcers.