This depends on the definition of "the ground". 5e uses typical terms in English, unless they are they are specifically given other meaning as game terms of art. In English, "the ground" is a relative term, since what is clearly ground to a giant might not be ground to a tiny bug. However, this would make the spell work awkwardly for different size classes; we already know it is 10ft in diameter. I would instead say ground is specifically anything which, as of very recently, counted as a hex or square on which a Medium creature could stand on in the presence of gravity (including with Spider Climb whether active or not). The ground would probably include any detritus which would make it be considered Difficult Terrain. For example:
- The rubble staircase of a flying ruined castle would be 'ground' (even though it isn't perfectly flat, it is equivalent to a hill; it has protrusions because it has a bunch of stones; it is wood and not earth and that is fine).
- However furniture and desks (especially if they have function are are searchable) would not count since they are separate items (unless the GM is treating them as Difficult Terrain).
- Vehicles are a bit ambiguous, but any vehicle which is treated as a hex/square you can stand on (e.g. not horses, ambiguously chariots) should probably count, like giving the command word to a Folding Boat then (because you are >500ft or somesuch) take an action to summon an Arcane Gate on it should be fine.
- It is ambiguous what happens to the portal if the ground suddenly disappears (if it is destroyed suddenly by the DM in some way in an epic destructive event); obviously the DM may then adjudicate.
Consequently: a portal may be at weird angles, and almost entirely flat or even sticking into the ground, if there exists sufficiently large rubble (e.g. bricks, small boulders, etc.) to change the normal surface over a few inches. Or just stick it on a wall (but not a curtain, since it's too flimsy to hypothetically stand on). Otherwise in a flat hallway, the portal would be sticking straight up.