For each poset P , we construct a polytope A (P ) called the P -associahedron. Similarly to the case of graph associahedra, the faces of A (P ) correspond to certain tubings of P . The Stasheff associahedron is a compactification of the configuration space of n points on a line, and we recover A (P ) as an analogous compactification of the space of order-preserving maps P → R. Motivated by the study of totally nonnegative critical varieties in the Grassmannian, we introduce affine poset cyclohedra and realize these polytopes as compactifications of configuration spaces of n points on a circle. For particular choices of (affine) posets, we obtain associahedra, cyclohedra, permutohedra, and type B permutohedra as special cases.