A can with a lid doesn't always solve the problem. I found them useless for many dogs so for the longest time I had the trash in the cabinet under the sink with a baby proof cabinet locks. That sucked so recently I looked into other options and they sell baby locks that can be used on many things inclusing trash cans. This is what Im talking about in case anyone is interested.
Its been about a month and so far so good.
I use one of these,
https://www.amazon.com/REAQER-Holder-Preventing-Leakage-Adjustable/dp/B07V6YMPCN
I wrap my hose in a cover,
https://www.amazon.com/JAKIA-Fleece-Insulator-Surface-Comfortable/dp/B089QQBWBR
and the combination basically holds the tube in place while giving some flexibility.
You could also use a magnetic quick connect so that the magnet fails before the machine falls over.
Or, you could use a child safety lock for cabinets or such, and put it in the opposite direction to where the machine would be pulled.
https://www.amazon.com/Cabinets-Drawers-Dishwasher-Adhesive-Drilling/dp/B072KPZMMV
You'll also find that you don't move as much in your sleep on CPAP as you won't be tossing and turning trying to breath.
I use and recommend this style: