  We investigate subsets with small sumset in arbitrary abelian groups. For an
abelian group $G$ and an $n$-element subset $Y \subseteq G$ we show that if $m
\ll s^2/(\log n)^2$, then the number of subsets $A \subseteq Y$ with $|A| = s$
and $|A + A| \leq m$ is at most \[2^{o(s)}\binom{\frac{m+\beta}{2}}{s},\] where
$\beta$ is the size of the largest subgroup of $G$ of size at most
$\left(1+o(1)\right)m$. This bound is sharp for $\mathbb{Z}$ and many other
groups. Our result improves the one of Campos and nearly bridges the remaining
gap in a conjecture of Alon, Balogh, Morris, and Samotij.
  We also explore the behaviour of uniformly chosen random sets $A \subseteq
\{1,\ldots,n\}$ with $|A| = s$ and $|A + A| \leq m$. Under the same assumption
that $m \ll s^2/(\log n)^2$, we show that with high probability there exists an
arithmetic progression $P \subseteq \mathbb{Z}$ of size at most $m/2 + o(m)$
containing all but $o(s)$ elements of $A$. Analogous results are obtained for
asymmetric sumsets, improving results by Campos, Coulson, Serra, and W\"otzel.
The main tool behind our proofs is a graph container theorem combined with a
variant of an asymmetric hypergraph container theorem.
