We show how to generate labeled and unlabeled outerplanar graphs with n vertices uniformly at random in polynomial time in n. To generate labeled outerplanar graphs, we present a counting technique using the decomposition of a graph according to its block structure, and compute the exact number of labeled outerplanar graphs. This allows us to make the correct probabilistic choices in a recursive generation of uniformly distributed outerplanar graphs. Next we modify our formulas to count rooted unlabeled graphs, and finally show how to use these formulas in a Las Vegas algorithm to generate unlabeled outerplanar graphs uniformly at random in expected polynomial time. random structures, outerplanar graphs, efficient counting, uniform generation