  The grand canonical ensemble of a $d$-dimensional Reissner-Nordstr\"om black
hole space in a cavity is analyzed. The realization of this ensemble is made
through the Euclidean path integral approach by giving the Euclidean action for
the black hole with the correct topology, and boundary conditions corresponding
to a cavity, where the fixed quantities are the temperature and the electric
potential. One performs a zero loop approximation to find and analyze the
stationary points of the reduced action. This yields two solutions for the
electrically charged black hole, $r_{+1}$, which is the smaller and unstable,
and $r_{+2}$, which is the larger and stable. One also analyzes the most
probable configurations, which are either a stable charged black hole or hot
flat space, mimicked by a nongravitating charged shell. Making the
correspondence between the action and the grand potential, one can get the
black hole thermodynamic quantities, such as the entropy, the mean charge, the
mean energy, and the thermodynamic pressure, as well as the Smarr formula,
shown to be valid only for the unstable black hole. We find that thermodynamic
stability is related to the positivity of the heat capacity at constant
electric potential and area of the cavity. We also comment on the most
favorable thermodynamic phases and phase transitions. We then choose $d = 5$,
which is singled out naturally from the other higher dimensions as it provides
an exact solution for the problem, and apply all the results previously found.
The case $d = 4$ is mentioned. We compare thermodynamic radii with the photonic
orbit radius and the Buchdahl-Andr\'easson-Wright bound radius in
$d$-dimensional Reissner-Nordstr\"om spacetimes and find they are unconnected,
showing that the connections displayed in the Schwarzschild case are not
generic, rather they are very restricted holding only in the pure gravitational
situation.
