$\newcommand{\Cantor}{\mathcal{C}}$A very nice metric space to accomplish this is $\Cantor = \{0,1 \}^{\mathbb{N}}$ consisting of all infinite binary sequences. (I'll take $\mathbb{N} = \{ 0 , 1 , 2 , \ldots \}$ in the sequel.) A metric for this space is given as follows: for $\mathbf{x} = ( x_n )_{n \in \mathbb{N}} , \mathbf{y} = ( y_n )_{n \in \mathbb{N}} \in \mathcal{N}$ we define $$d ( \mathbf{x} , \mathbf{y} ) = \begin{cases}
0, &\text{if }\mathbf{x} = \mathbf{y} \\
2^{-(n+1)}, &\text{if }\mathbf{x} \neq \mathbf{y}, n = \min \{ n \in \mathbb{N} : x_n \neq y_n \}.
\end{cases}$$
A basis for this space is obtained by taking all sets of the form $$[s] = \{ \mathbf{x} \in \Cantor : s \sqsubset \mathbf{x} \}$$where $s$ is a finite binary sequence (and $s \sqsubset \mathbf{x}$ means that $s$ is an initial segment of $\mathbf{x}$).
(This space is homeomorphic to the usual Cantor ternary set, and is, unsurprisingly, called the Cantor space.)
A purely formal construction of the required sets is as follows: For each $n$ let $$E_n = \{ \mathbf{x} \in \Cantor : \mathbf{x} \text{ has at most }n \text{ }1\text{s} \}$$ These sets are easily seen to be closed. (If $\mathbf{y} \notin E_n$, then $\mathbf{y}$ has at least $n+1$ $1$s, so let $\ell$ be the coordinate of the $(n+1)$st $1$, and let $s$ be the initial segment of $\mathbf{y}$ up to (and including) the $\ell$th coordinate. Then every $\mathbf{z} \in [s]$ contains at least $n+1$ $1$s, and is not in $E_n$.)
We claim that $( E_{n+1} )^\prime = E_n$. Note that if $\mathbf{x} \in E_{n+1} \setminus E_n$, then $\mathbf{x}$ has exactly $n+1$ $1$s in it. Let $\ell$ denote the coordinate of the $(n+1)$st $1$ in $\mathbf{x}$, and let $s$ denote the initial segment of $\mathbf{x}$ up to, and including, the $\ell$th coordinate. Then $E_{n+1} \cap [s] = \{ \mathbf{x} \}$, and so $\mathbf{x}$ is an isolated point of $E_{n+1}$. This implies that $(E_{n+1})^\prime \subseteq E_n$. Conversely, if $\mathbf{x} \in E_n \subseteq E_{n+1}$ then given any initial segment $s$ of $x$ we can find a coordinate $\ell > \mathrm{length} (s)$ such that $x_\ell = 0$. Define $\mathbf{y}$ so that $$y_n = \begin{cases}
x_n, &\text{if }n \neq \ell \\
1, &\text{if }n = \ell.
\end{cases}$$
Then $\mathbf{y} \in E_{n+1} \cap [s]$ and is distinct from $\mathbf{x}$. Therefore $\mathbf{x} \in E_{n+1}^\prime$.
(One can go quite a bit further and construct, for each $\alpha < \omega_1$ a closed $E \subseteq \Cantor$ such that $E^{(\alpha)} \neq \emptyset$ but $E^{(\alpha+1)} = \emptyset$.)
The nice thing about $\Cantor$ is that if $X$ is any nonempty perfect Polish space (i.e. a separable complete metric without isolated points) includes a closed homeomorphic copy of $\Cantor$, and so every nonempty perfect Polish space has closed subsets of the kind desired.