Depending on the placement you’re after you can quite literally hot glue it, or use 3M command tape, or fabricate a little bracket/housing using hobbyist plastics or wood. Hot glue is probably the most common method since if done tidily it’s a strong hold but can be cleanly removed if required.