We introduce the notion of a matroid $M$ over a commutative ring $R$, assigning to every subset of the ground set an $R$-module according to some axioms. When $R$ is a field, we recover matroids. When $R=\mathbb{Z}$, and when $R$ is a DVR, we get (structures which contain all the data of) quasi-arithmetic matroids, and valuated matroids, i.e. tropical linear spaces, respectively. More generally, whenever $R$ is a Dedekind domain, we extend all the usual properties and operations holding for matroids (e.g., duality), and...