Let G be a locally compact group, E its trivial subgroup and \(\mathcal {SUB}\!\left( G\right) \) the set of closed subgroups of G endowed with the Chabauty topology; this is a compact space. Let \({\mathcal {S}\hspace{-0.5pt}\mathcal {U}\hspace{-0.9pt}\mathcal {B}}_{\textrm{c}}\hspace{-0.5pt}\left( G\right) \) (resp. \({\mathcal {S}\hspace{-0.5pt}\mathcal {U}\hspace{-0.9pt}\mathcal {B}}_{\textrm{c}\hspace{0.56917pt}\textrm{o}}\hspace{-0.5pt}\left( G\right) \) ) denote the subspace of all compact (resp. compact open) subgroups of G. We say that G is compactly ruled if it is a directed union of compact open subgroups. It was shown by Hamrouni and Jlali, in (Proc Math Sci 131:1–10, 2021), that G is compactly ruled and totally disconnected if and only if \({\mathcal {S}\hspace{-0.5pt}\mathcal {U}\hspace{-0.9pt}\mathcal {B}}_{\textrm{c}\hspace{0.56917pt}\textrm{o}}\hspace{-0.5pt}\left( G\right) \) is dense in \(\mathcal {SUB}\!\left( G\right) \) . In this paper, we characterize compactly ruled groups as follows: G is compactly ruled if and only if \(G\in \overline{{\mathcal {S}\hspace{-0.5pt}\mathcal {U}\hspace{-0.9pt}\mathcal {B}}_{\textrm{c}}\hspace{-0.5pt}\left( G\right) }\) if and only if \(G\in \overline{{\mathcal {S}\hspace{-0.5pt}\mathcal {U}\hspace{-0.9pt}\mathcal {B}}_{\textrm{c}\hspace{0.56917pt}\textrm{o}}\hspace{-0.5pt}\left( G\right) }\) . Furthermore, we provide a more precise characterization in the case of total disconnectedness: G is compactly ruled and totally disconnected if and only if \(\{E,G\}\subset \overline{{\mathcal {S}\hspace{-0.5pt}\mathcal {U}\hspace{-0.9pt}\mathcal {B}}_{\textrm{c}\hspace{0.56917pt}\textrm{o}}\hspace{-0.5pt}\left( G\right) }\) .